This file lists all bug fixes, changes, etc., made since the
second edition of the AWK book was published in September 2023.
+Oct 30, 2023:
+ multiple fixes and a minor code cleanup.
+ disabled utf-8 for non-multibyte locales, such as C or POSIX.
+ fixed a bad char * cast that causes incorrect results on big-endian
+ systems. also fixed an out-of-bounds read for empty CCL.
+ fixed a buffer overflow in substr with utf-8 strings.
+ many thanks to Todd C Miller.
+
+
Sep 24, 2023:
fnematch and getrune have been overhauled to solve issues around
unicode FS and RS. also fixed gsub null match issue with unicode.
-/* $OpenBSD: main.c,v 1.63 2023/10/06 22:29:24 millert Exp $ */
+/* $OpenBSD: main.c,v 1.64 2023/10/31 01:08:51 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20231001";
+const char *version = "version 20231030";
#define DEBUG
#include <stdio.h>
#include <unistd.h>
#include "awk.h"
+extern char *__progname;
extern char **environ;
extern int nfields;
-extern char *__progname;
int dbg = 0;
Awkfloat srand_seed = 1;
setlocale(LC_CTYPE, "");
setlocale(LC_NUMERIC, "C"); /* for parsing cmdline & prog */
awk_mb_cur_max = MB_CUR_MAX;
-
cmdname = __progname;
+
if (pledge("stdio rpath wpath cpath proc exec", NULL) == -1) {
fprintf(stderr, "%s: pledge: incorrect arguments\n",
cmdname);
if (argc == 1) {
fprintf(stderr, "usage: %s [-safe] [-V] [-d[n]] "
"[-f fs | --csv] [-v var=value]\n"
- "\t [prog | -f progfile] file ...\n",
- cmdname);
- exit(1);
+ "\t [prog | -f progfile] file ...\n", cmdname);
+ return 1;
}
#ifdef SA_SIGINFO
{
dbg = 1;
printf("awk %s\n", version);
break;
- case 'V': /* added for exptools "standard" */
+ case 'V':
printf("awk %s\n", version);
return 0;
default: