summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2020-06-10 21:06:10 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2020-06-10 21:06:10 +0000
commita0ccf81ea90f2d460899d096f6f86be3c8405fcd (patch)
tree79130fab63f5f4db8849903602007cf1bc460d47 /usr.bin
parent51d4d907451fc49d221f7bdaeb344daf7b57a3ef (diff)
Update awk to June 5, 2020 version.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/awk/FIXES19
-rw-r--r--usr.bin/awk/awk.h7
-rw-r--r--usr.bin/awk/lib.c6
-rw-r--r--usr.bin/awk/main.c6
-rw-r--r--usr.bin/awk/proto.h8
5 files changed, 35 insertions, 11 deletions
diff --git a/usr.bin/awk/FIXES b/usr.bin/awk/FIXES
index 71dae0003a9..60fb568ddb6 100644
--- a/usr.bin/awk/FIXES
+++ b/usr.bin/awk/FIXES
@@ -1,4 +1,4 @@
-/* $OpenBSD: FIXES,v 1.32 2020/06/10 21:05:50 millert Exp $ */
+/* $OpenBSD: FIXES,v 1.33 2020/06/10 21:06:09 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -26,6 +26,23 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the AWK book
was sent to the printers in August, 1987.
+June 5, 2020:
+ In fldbld(), make sure that inputFS is set before trying to
+ use it. Thanks to Steffen Nurpmeso <steffen@sdaoden.eu>
+ for the report.
+
+May 5, 2020:
+ Fix checks for compilers that can handle noreturn. Thanks to
+ GitHub user enh-google for pointing it out. Closes Issue #79.
+
+April 16, 2020:
+ Handle old compilers that don't support C11 (for noreturn).
+ Thanks to Arnold Robbins.
+
+April 5, 2020:
+ Use <stdnoreturn.h> and noreturn instead of GCC attributes.
+ Thanks to GitHub user awkfan77. Closes PR #77.
+
February 28, 2020:
More cleanups from Christos Zoulas: notably backslash continuation
inside strings removes the newline and a fix for RS = "^a".
diff --git a/usr.bin/awk/awk.h b/usr.bin/awk/awk.h
index e010dd7184d..e55af318b9a 100644
--- a/usr.bin/awk/awk.h
+++ b/usr.bin/awk/awk.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: awk.h,v 1.22 2020/06/10 21:05:02 millert Exp $ */
+/* $OpenBSD: awk.h,v 1.23 2020/06/10 21:06:09 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -26,6 +26,11 @@ THIS SOFTWARE.
#include <assert.h>
#include <stdint.h>
#include <stdbool.h>
+#if __STDC_VERSION__ <= 199901L
+#define noreturn __dead
+#else
+#include <stdnoreturn.h>
+#endif
typedef double Awkfloat;
diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c
index dfcc3352a25..71ff7cfd818 100644
--- a/usr.bin/awk/lib.c
+++ b/usr.bin/awk/lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.c,v 1.34 2020/06/10 21:05:50 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.35 2020/06/10 21:06:09 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -333,6 +333,8 @@ void fldbld(void) /* create fields from current record */
}
fr = fields;
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 */
i = refldbld(r, inputFS);
} else if ((sep = *inputFS) == ' ') { /* default whitespace */
@@ -624,7 +626,7 @@ void bcheck2(int n, int c1, int c2)
fprintf(stderr, "\t%d extra %c's\n", -n, c2);
}
-__dead void FATAL(const char *fmt, ...)
+void FATAL(const char *fmt, ...)
{
extern char *cmdname;
va_list varg;
diff --git a/usr.bin/awk/main.c b/usr.bin/awk/main.c
index 942906ceef2..d60ad02f29c 100644
--- a/usr.bin/awk/main.c
+++ b/usr.bin/awk/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.37 2020/06/10 21:05:50 millert Exp $ */
+/* $OpenBSD: main.c,v 1.38 2020/06/10 21:06:09 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20200228";
+const char *version = "version 20200605";
#define DEBUG
#include <stdio.h>
@@ -55,7 +55,7 @@ static size_t curpfile; /* current filename */
bool safe = false; /* true => "safe" mode */
-static __attribute__((__noreturn__)) void fpecatch(int n
+static noreturn void fpecatch(int n
#ifdef SA_SIGINFO
, siginfo_t *si, void *uc
#endif
diff --git a/usr.bin/awk/proto.h b/usr.bin/awk/proto.h
index 561d4ff660e..3a876c56ce7 100644
--- a/usr.bin/awk/proto.h
+++ b/usr.bin/awk/proto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: proto.h,v 1.17 2020/06/10 21:05:50 millert Exp $ */
+/* $OpenBSD: proto.h,v 1.18 2020/06/10 21:06:09 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -47,7 +47,7 @@ extern void freetr(Node *);
extern int hexstr(const uschar **);
extern int quoted(const uschar **);
extern char *cclenter(const char *);
-extern void overflo(const char *) __attribute__((__noreturn__));
+extern noreturn void overflo(const char *);
extern void cfoll(fa *, Node *);
extern int first(Node *);
extern void follow(Node *);
@@ -138,8 +138,8 @@ extern void bracecheck(void);
extern void bcheck2(int, int, int);
extern void SYNTAX(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
-extern void FATAL(const char *, ...)
- __attribute__((__format__(__printf__, 1, 2), __noreturn__));
+extern noreturn void FATAL(const char *, ...)
+ __attribute__((__format__(__printf__, 1, 2)));
extern void WARNING(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
extern void error(void);