diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:57:07 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:57:07 +0300 |
commit | 3ca7f0b16d0a5c105380b284a81c6a1b2c210908 (patch) | |
tree | c2153d226b9cba3ebca0c3556b19bf3e52cd20dd /main.c | |
parent | f20ab7c3039a4023f41372bfe4bde3b16d481df7 (diff) | |
download | egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.tar.gz egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.tar.bz2 egawk-3ca7f0b16d0a5c105380b284a81c6a1b2c210908.zip |
Move to gawk-3.0.5.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -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. @@ -175,10 +175,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)); @@ -377,9 +384,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"); @@ -439,8 +443,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); } @@ -450,7 +455,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\ @@ -652,8 +657,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. |