diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2020-06-10 21:03:57 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2020-06-10 21:03:57 +0000 |
commit | 880d51e71759acbe9ba8f99017b9c4db18cec243 (patch) | |
tree | 2e8289de580096a9e7b281483efaec653bdc293e /usr.bin/awk/run.c | |
parent | 64f0343d590e58d28ed139270fa1948c7e41aa8a (diff) |
Update awk to Nov 10, 2019 version.
Diffstat (limited to 'usr.bin/awk/run.c')
-rw-r--r-- | usr.bin/awk/run.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.bin/awk/run.c b/usr.bin/awk/run.c index b74723ea89e..2b2a775c703 100644 --- a/usr.bin/awk/run.c +++ b/usr.bin/awk/run.c @@ -1,4 +1,4 @@ -/* $OpenBSD: run.c,v 1.53 2020/06/10 21:03:36 millert Exp $ */ +/* $OpenBSD: run.c,v 1.54 2020/06/10 21:03:56 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -192,7 +192,7 @@ Cell *program(Node **a, int n) /* execute an awk program */ tempfree(x); } if (a[1] || a[2]) - while (getrec(&record, &recsize, 1) > 0) { + while (getrec(&record, &recsize, true) > 0) { x = execute(a[1]); if (isexit(x)) break; @@ -442,9 +442,9 @@ Cell *awkgetline(Node **a, int n) /* get next line from specific input */ } } else { /* bare getline; use current input */ if (a[0] == NULL) /* getline */ - n = getrec(&record, &recsize, 1); + n = getrec(&record, &recsize, true); else { /* getline var */ - n = getrec(&buf, &bufsize, 0); + n = getrec(&buf, &bufsize, false); x = execute(a[0]); setsval(x, buf); if (is_number(x->sval)) { @@ -461,7 +461,7 @@ Cell *awkgetline(Node **a, int n) /* get next line from specific input */ Cell *getnf(Node **a, int n) /* get NF */ { - if (donefld == 0) + if (!donefld) fldbld(); return (Cell *) a[0]; } @@ -825,15 +825,15 @@ int format(char **pbuf, int *pbufsize, const char *s, Node *a) /* printf-like co #define FMTSZ(a) (fmtsz - ((a) - fmt)) #define BUFSZ(a) (bufsize - ((a) - buf)) - static int first = 1; - static int have_a_format = 0; + static bool first = true; + static bool have_a_format = false; if (first) { char buf[100]; snprintf(buf, sizeof(buf), "%a", 42.0); have_a_format = (strcmp(buf, "0x1.5p+5") == 0); - first = 0; + first = false; } os = s; |