Small cleanups before merge to master.
This commit is contained in:
parent
94e4c04561
commit
ed6ff8c1cb
4
FIXES
4
FIXES
@ -25,6 +25,10 @@ THIS SOFTWARE.
|
||||
This file lists all bug fixes, changes, etc., made since the AWK book
|
||||
was sent to the printers in August, 1987.
|
||||
|
||||
February 18, 2020:
|
||||
Additional cleanups from Christos Zoulas. It's no longer necessary
|
||||
to use the -y flag to bison.
|
||||
|
||||
February 6, 2020:
|
||||
Additional small cleanups from Christos Zoulas. awk is now
|
||||
a little more robust about reporting I/O errors upon exit.
|
||||
|
12
main.c
12
main.c
@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
|
||||
THIS SOFTWARE.
|
||||
****************************************************************/
|
||||
|
||||
const char *version = "version 20200206";
|
||||
const char *version = "version 20200218";
|
||||
|
||||
#define DEBUG
|
||||
#include <stdio.h>
|
||||
@ -57,7 +57,7 @@ static __attribute__((__noreturn__)) void fpecatch(int n
|
||||
, siginfo_t *si, void *uc
|
||||
#endif
|
||||
)
|
||||
{
|
||||
{
|
||||
#ifdef SA_SIGINFO
|
||||
static const char *emsg[] = {
|
||||
[0] = "Unknown error",
|
||||
@ -73,7 +73,7 @@ static __attribute__((__noreturn__)) void fpecatch(int n
|
||||
#endif
|
||||
FATAL("floating point exception"
|
||||
#ifdef SA_SIGINFO
|
||||
": %s\n", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) &&
|
||||
": %s", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) &&
|
||||
emsg[si->si_code] ? emsg[si->si_code] : emsg[0]
|
||||
#endif
|
||||
);
|
||||
@ -144,8 +144,7 @@ int main(int argc, char *argv[])
|
||||
yyin = NULL;
|
||||
symtab = makesymtab(NSYMTAB/NSYMTAB);
|
||||
while (argc > 1 && argv[1][0] == '-' && argv[1][1] != '\0') {
|
||||
if (strcmp(argv[1], "-version") == 0 ||
|
||||
strcmp(argv[1], "--version") == 0) {
|
||||
if (strcmp(argv[1], "-version") == 0 || strcmp(argv[1], "--version") == 0) {
|
||||
printf("awk %s\n", version);
|
||||
return 0;
|
||||
}
|
||||
@ -165,8 +164,7 @@ int main(int argc, char *argv[])
|
||||
maxpfile += 20;
|
||||
pfile = realloc(pfile, maxpfile * sizeof(*pfile));
|
||||
if (pfile == NULL)
|
||||
FATAL("error allocating space for "
|
||||
"-f options");
|
||||
FATAL("error allocating space for -f options");
|
||||
}
|
||||
pfile[npfile++] = fn;
|
||||
break;
|
||||
|
@ -139,7 +139,7 @@ int main(int argc, char *argv[])
|
||||
if (tokentype != TOK_ENUM) {
|
||||
n = sscanf(buf, "%1c %199s %199s %d", &c, def, name,
|
||||
&tok);
|
||||
if (c == '#' && n == 4 && strcmp(def, "define") == 0) {
|
||||
if (n == 4 && c == '#' && strcmp(def, "define") == 0) {
|
||||
tokentype = TOK_DEFINE;
|
||||
} else if (tokentype != TOK_UNKNOWN) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user