aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2018-04-04 17:07:07 +0200
committerDuncaen <mail@duncano.de>2018-04-04 17:32:09 +0200
commit1a4d8793323fcad4f305204bb9f00e635b3fe4d4 (patch)
tree689a6221344875c5227e725a78f69760557bab57
parent22ce3fa31c147409b4891426fa9a676e5faad5bc (diff)
downloadlobase-1a4d8793323fcad4f305204bb9f00e635b3fe4d4.tar.gz
usr.bin/awk: update to OPENBSD_6_3
-rw-r--r--usr.bin/awk/b.c6
-rw-r--r--usr.bin/awk/lib.c26
-rw-r--r--usr.bin/awk/tran.c4
3 files changed, 17 insertions, 19 deletions
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c
index a3a8380..20a4c75 100644
--- a/usr.bin/awk/b.c
+++ b/usr.bin/awk/b.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: b.c,v 1.19 2017/10/09 14:51:31 deraadt Exp $ */
+/* $OpenBSD: b.c,v 1.20 2018/01/24 16:28:25 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -261,6 +261,8 @@ int quoted(uschar **pp) /* pick up next thing after a \\ */
if ((c = *p++) == 't')
c = '\t';
+ else if (c == 'v')
+ c = '\v';
else if (c == 'n')
c = '\n';
else if (c == 'f')
@@ -269,6 +271,8 @@ int quoted(uschar **pp) /* pick up next thing after a \\ */
c = '\r';
else if (c == 'b')
c = '\b';
+ else if (c == 'a')
+ c = '\007';
else if (c == '\\')
c = '\\';
else if (c == 'x') { /* hexadecimal goo follows */
diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c
index 2a40a02..f1ff647 100644
--- a/usr.bin/awk/lib.c
+++ b/usr.bin/awk/lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.c,v 1.24 2017/10/09 14:51:31 deraadt Exp $ */
+/* $OpenBSD: lib.c,v 1.25 2017/12/08 17:04:15 deraadt Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -532,33 +532,25 @@ void SYNTAX(const char *fmt, ...)
void fpecatch(int sig)
{
extern Node *curnode;
- char buf[1024];
- snprintf(buf, sizeof buf, "floating point exception\n");
- write(STDERR_FILENO, buf, strlen(buf));
+ dprintf(STDERR_FILENO, "floating point exception\n");
if (compile_time != 2 && NR && *NR > 0) {
- snprintf(buf, sizeof buf, " input record number %d", (int) (*FNR));
- write(STDERR_FILENO, buf, strlen(buf));
-
+ dprintf(STDERR_FILENO, " input record number %d", (int) (*FNR));
if (strcmp(*FILENAME, "-") != 0) {
- snprintf(buf, sizeof buf, ", file %s", *FILENAME);
- write(STDERR_FILENO, buf, strlen(buf));
+ dprintf(STDERR_FILENO, ", file %s", *FILENAME);
}
- write(STDERR_FILENO, "\n", 1);
+ dprintf(STDERR_FILENO, "\n");
}
if (compile_time != 2 && curnode) {
- snprintf(buf, sizeof buf, " source line number %d", curnode->lineno);
- write(STDERR_FILENO, buf, strlen(buf));
+ dprintf(STDERR_FILENO, " source line number %d", curnode->lineno);
} else if (compile_time != 2 && lineno) {
- snprintf(buf, sizeof buf, " source line number %d", lineno);
- write(STDERR_FILENO, buf, strlen(buf));
+ dprintf(STDERR_FILENO, " source line number %d", lineno);
}
if (compile_time == 1 && cursource() != NULL) {
- snprintf(buf, sizeof buf, " source file %s", cursource());
- write(STDERR_FILENO, buf, strlen(buf));
+ dprintf(STDERR_FILENO, " source file %s", cursource());
}
- write(STDERR_FILENO, "\n", 1);
+ dprintf(STDERR_FILENO, "\n");
if (dbg > 1) /* core dump if serious debugging on */
abort();
_exit(1);
diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c
index f9a72c0..cec7d08 100644
--- a/usr.bin/awk/tran.c
+++ b/usr.bin/awk/tran.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tran.c,v 1.16 2017/10/09 14:51:31 deraadt Exp $ */
+/* $OpenBSD: tran.c,v 1.17 2018/01/24 16:28:25 millert Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -436,9 +436,11 @@ char *qstring(const char *is, int delim) /* collect string up to next delim */
case '\\': *bp++ = '\\'; break;
case 'n': *bp++ = '\n'; break;
case 't': *bp++ = '\t'; break;
+ case 'v': *bp++ = '\v'; break;
case 'b': *bp++ = '\b'; break;
case 'f': *bp++ = '\f'; break;
case 'r': *bp++ = '\r'; break;
+ case 'a': *bp++ = '\007'; break;
default:
if (!isdigit(c)) {
*bp++ = c;