* Fixed readcsvrec resize segfault when reading csv records longer than 8k.
* Rewrite if-else chain in quoted as a switch.
This file lists all bug fixes, changes, etc., made since the
second edition of the AWK book was published in September 2023.
+Jul 28, 2024
+ Fixed readcsvrec resize segfault when reading csv records longer
+ than 8k. Thanks to Ozan Yigit.
+ mktime() added to bsd-features branch. Thanks to Todd Miller.
+
+Jun 23, 2024
+ Fix signal for system-status test. Thanks to Tim van der Molen.
+ Rewrite if-else chain as switch. Thanks to Andrew Sukach.
+
May 27, 2024
Spelling fixes and removal of unneeded prototypes and extern.
Thanks to Jonathan Gray.
-/* $OpenBSD: b.c,v 1.53 2024/06/03 00:55:05 millert Exp $ */
+/* $OpenBSD: b.c,v 1.54 2024/08/03 21:12:16 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
/* BUG: should advance by utf-8 char even if makes no sense */
- if ((c = *p++) == 't') {
+ switch ((c = *p++)) {
+ case 't':
c = '\t';
- } else if (c == 'n') {
+ break;
+ case 'n':
c = '\n';
- } else if (c == 'f') {
+ break;
+ case 'f':
c = '\f';
- } else if (c == 'r') {
+ break;
+ case 'r':
c = '\r';
- } else if (c == 'b') {
+ break;
+ case 'b':
c = '\b';
- } else if (c == 'v') {
+ break;
+ case 'v':
c = '\v';
- } else if (c == 'a') {
+ break;
+ case 'a':
c = '\a';
- } else if (c == '\\') {
+ break;
+ case '\\':
c = '\\';
- } else if (c == 'x') { /* 2 hex digits follow */
- c = hexstr(&p, 2); /* this adds a null if number is invalid */
- } else if (c == 'u') { /* unicode char number up to 8 hex digits */
+ break;
+ case 'x': /* 2 hex digits follow */
+ c = hexstr(&p, 2); /* this adds a null if number is invalid */
+ break;
+ case 'u': /* unicode char number up to 8 hex digits */
c = hexstr(&p, 8);
- } else if (isoctdigit(c)) { /* \d \dd \ddd */
- int n = c - '0';
- if (isoctdigit(*p)) {
- n = 8 * n + *p++ - '0';
- if (isoctdigit(*p))
+ break;
+ default:
+ if (isoctdigit(c)) { /* \d \dd \ddd */
+ int n = c - '0';
+ if (isoctdigit(*p)) {
n = 8 * n + *p++ - '0';
+ if (isoctdigit(*p))
+ n = 8 * n + *p++ - '0';
+ }
+ c = n;
}
- c = n;
- } /* else */
- /* c = c; */
+ }
+
*pp = p;
return c;
}
-/* $OpenBSD: lib.c,v 1.58 2024/06/03 00:55:05 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.59 2024/08/03 21:12:16 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
char *rs = getsval(rsloc);
if (CSV) {
- c = readcsvrec(pbuf, pbufsize, inf, newflag);
+ c = readcsvrec(&buf, &bufsize, inf, newflag);
isrec = (c == EOF && rr == buf) ? false : true;
} else if (*rs && rs[1]) {
bool found;
-/* $OpenBSD: main.c,v 1.71 2024/06/03 00:58:04 millert Exp $ */
+/* $OpenBSD: main.c,v 1.72 2024/08/03 21:12:16 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20240527";
+const char *version = "version 20240728";
#define DEBUG
#include <stdio.h>