-$OpenBSD: README.md,v 1.7 2023/09/17 14:49:44 millert Exp $
+$OpenBSD: README.md,v 1.8 2023/10/30 17:52:54 millert Exp $
# The One True Awk
The option `--csv` turns on CSV processing of input:
fields are separated by commas, fields may be quoted with
-double-quote (`"`) characters, fields may contain embedded newlines.
+double-quote (`"`) characters, quoted fields may contain embedded newlines.
In CSV mode, `FS` is ignored.
If no explicit separator argument is provided,
-/* $OpenBSD: b.c,v 1.44 2023/10/06 22:31:21 millert Exp $ */
+/* $OpenBSD: b.c,v 1.45 2023/10/30 17:52:54 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
}
while (c < c2) {
if (i >= bufsz) {
- buf = (int *) reallocarray(buf, bufsz, sizeof(int) * 2);
+ buf = (int *) reallocarray(buf, bufsz, 2 * sizeof(int));
if (buf == NULL)
FATAL("out of space for character class [%.10s...] 2", p);
bufsz *= 2;
}
}
if (i >= bufsz) {
- buf = (int *) reallocarray(buf, bufsz, sizeof(int) * 2);
+ buf = (int *) reallocarray(buf, bufsz, 2 * sizeof(int));
if (buf == NULL)
FATAL("out of space for character class [%.10s...] 2", p);
bufsz *= 2;
-/* $OpenBSD: lib.c,v 1.53 2023/10/30 16:14:51 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.54 2023/10/30 17:52:54 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
}
if (found)
setptr(patbeg, '\0');
- isrec = (found == 0 && *buf == '\0') ? 0 : 1;
+ isrec = (found == 0 && *buf == '\0') ? false : true;
} else {
if ((sep = *rs) == 0) {
sep = '\n';
if (!adjbuf(&buf, &bufsize, 1+rr-buf, recsize, &rr, "readrec 3"))
FATAL("input record `%.30s...' too long", buf);
*rr = 0;
- isrec = (c == EOF && rr == buf) ? 0 : 1;
+ isrec = (c == EOF && rr == buf) ? false : true;
}
*pbuf = buf;
*pbufsize = bufsize;
-/* $OpenBSD: maketab.c,v 1.20 2020/07/30 17:45:44 millert Exp $ */
+/* $OpenBSD: maketab.c,v 1.21 2023/10/30 17:52:54 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
}
if (tok < FIRSTTOKEN || tok > LASTTOKEN) {
tokentype = TOK_UNKNOWN;
- /* fprintf(stderr, "maketab: funny token %d %s ignored\n", tok, buf); */
+ /* fprintf(stderr, "maketab funny token %d %s ignored\n", tok, buf); */
continue;
}
names[tok-FIRSTTOKEN] = strdup(name);
if (names[tok-FIRSTTOKEN] == NULL) {
fprintf(stderr, "maketab out of space copying %s", name);
- exit(1);
+ return 1;
}
printf("\t\"%s\",\t/* %d */\n", name, tok);
i++;
-/* $OpenBSD: tran.c,v 1.37 2023/09/17 14:49:44 millert Exp $ */
+/* $OpenBSD: tran.c,v 1.38 2023/10/30 17:52:54 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
for (i = 0; i < ac; i++) {
double result;
- snprintf(temp, sizeof temp, "%d", i);
+ snprintf(temp, sizeof(temp), "%d", i);
if (is_number(*av, & result))
setsymtab(temp, *av, result, STR|NUM, ARGVtab);
else