This file lists all bug fixes, changes, etc., made since the
second edition of the AWK book was published in September 2023.
+Nov 27, 2023:
+ Fix exit status of system on MacOS. update to REGRESS.
+ Thanks to Arnold Robbins.
+ Fix inconsistent handling of -F and --csv, and loss of csv
+ mode when FS is set. Thanks to Wilbert van der Poel.
+
Nov 24, 2023:
Fix issue #199: gototab improvements to dynamically resize the
table, qsort and bsearch to improve the lookup speed as the
### Regular expressions ###
Regular expressions may include UTF-8 code points, including `\u`.
-Character classes are likely to be limited to about 256 characters
-when expanded.
### CSV ###
-/* $OpenBSD: lib.c,v 1.54 2023/10/30 17:52:54 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.55 2023/11/28 20:54:38 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
i = 0; /* number of fields accumulated here */
if (inputFS == NULL) /* make sure we have a copy of FS */
savefs();
- if (strlen(inputFS) > 1) { /* it's a regular expression */
+ if (!CSV && strlen(inputFS) > 1) { /* it's a regular expression */
i = refldbld(r, inputFS);
} else if (!CSV && (sep = *inputFS) == ' ') { /* default whitespace */
for (i = 0; ; ) {
-/* $OpenBSD: main.c,v 1.66 2023/11/25 16:31:33 millert Exp $ */
+/* $OpenBSD: main.c,v 1.67 2023/11/28 20:54:38 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20231124";
+const char *version = "version 20231127";
#define DEBUG
#include <stdio.h>
}
if (strcmp(argv[1], "--csv") == 0) { /* turn on csv input processing */
CSV = true;
+ if (fs)
+ WARNING("danger: don't set FS when --csv is in effect");
argc--;
argv++;
continue;
break;
case 'F': /* set field separator */
fs = setfs(getarg(&argc, &argv, "no field separator"));
+ if (CSV)
+ WARNING("danger: don't set FS when --csv is in effect");
break;
case 'v': /* -v a=1 to be done NOW. one -v for each */
vn = getarg(&argc, &argv, "no variable name");
-/* $OpenBSD: run.c,v 1.82 2023/11/25 16:31:33 millert Exp $ */
+/* $OpenBSD: run.c,v 1.83 2023/11/28 20:54:38 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
int status = 0;
time_t tv;
struct tm *tm, tmbuf;
+ int estatus = 0;
t = ptoi(a[0]);
x = execute(a[1]);
break;
case FSYSTEM:
fflush(stdout); /* in case something is buffered already */
- status = system(getsval(x));
- u = status;
+ estatus = status = system(getsval(x));
if (status != -1) {
if (WIFEXITED(status)) {
- u = WEXITSTATUS(status);
+ estatus = WEXITSTATUS(status);
} else if (WIFSIGNALED(status)) {
- u = WTERMSIG(status) + 256;
+ estatus = WTERMSIG(status) + 256;
#ifdef WCOREDUMP
if (WCOREDUMP(status))
- u += 256;
+ estatus += 256;
#endif
} else /* something else?!? */
- u = 0;
+ estatus = 0;
}
+ /* else estatus was set to -1 */
+ u = estatus;
break;
case FRAND:
/* random() returns numbers in [0..2^31-1]