summaryrefslogtreecommitdiffstats
path: root/contrib/awk/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/awk/main.c')
-rw-r--r--contrib/awk/main.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/contrib/awk/main.c b/contrib/awk/main.c
index 27452f0..bbd7d71 100644
--- a/contrib/awk/main.c
+++ b/contrib/awk/main.c
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991-1999 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991-2000 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
@@ -177,10 +177,17 @@ char **argv;
/* Set up the special variables */
/*
* Note that this must be done BEFORE arg parsing else -F
- * breaks horribly
+ * breaks horribly.
*/
init_vars();
+ /* Set up the field variables */
+ /*
+ * Do this before arg parsing so that `-v NF=blah' won't
+ * break anything.
+ */
+ init_fields();
+
/* worst case */
emalloc(srcfiles, struct src *, argc * sizeof(struct src), "main");
memset(srcfiles, '\0', argc * sizeof(struct src));
@@ -379,9 +386,6 @@ out:
(void) alloca(0);
#endif
- /* Set up the field variables */
- init_fields();
-
if (do_lint && begin_block == NULL && expression_value == NULL
&& end_block == NULL)
warning("no program");
@@ -441,8 +445,9 @@ FILE *fp;
fputs("\t-W traditional\t\t--traditional\n", fp);
fputs("\t-W usage\t\t--usage\n", fp);
fputs("\t-W version\t\t--version\n", fp);
- fputs("\nReport bugs to bug-gnu-utils@gnu.org,\n", fp);
- fputs("with a Cc: to arnold@gnu.org\n", fp);
+ fputs("\nTo report bugs, see node `Bugs' in `gawk.info', which\n", fp);
+ fputs("is section `Reporting Problems and Bugs' in the\n", fp);
+ fputs("printed version.\n", fp);
exit(exitval);
}
@@ -452,7 +457,7 @@ static void
copyleft()
{
static char blurb_part1[] =
-"Copyright (C) 1989, 1991-1999 Free Software Foundation.\n\
+"Copyright (C) 1989, 1991-2000 Free Software Foundation.\n\
\n\
This program is free software; you can redistribute it and/or modify\n\
it under the terms of the GNU General Public License as published by\n\
@@ -654,8 +659,13 @@ char *arg;
badvar = TRUE;
break;
}
- if (badvar)
- fatal("illegal name `%s' in variable assignment", arg);
+
+ if (badvar) {
+ if (do_lint)
+ warning("illegal name `%s' in variable assignment", arg);
+ *--cp = '='; /* restore original text of ARGV */
+ return NULL;
+ }
/*
* Recent versions of nawk expand escapes inside assignments.
OpenPOWER on IntegriCloud