aboutsummaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2011-05-06 14:08:24 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2011-05-06 14:08:24 +0000
commite2f76e526c9828f75cb69d51857e9efd1ed0684f (patch)
tree3bd96c6c930a25429b3c0cf7413942cb20dd8d99 /main.c
parentf11de2916976d54dd9f4f804dda1c290783aaa90 (diff)
downloadsrc-e2f76e526c9828f75cb69d51857e9efd1ed0684f.tar.gz
src-e2f76e526c9828f75cb69d51857e9efd1ed0684f.zip
Vendor import of bwk's 6-May-2011 release.vendor/one-true-awk/20110506
Notes
Notes: svn path=/vendor/one-true-awk/dist/; revision=221530 svn path=/vendor/one-true-awk/20110506/; revision=221531; tag=vendor/one-true-awk/20110506
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/main.c b/main.c
index a125bc1eb1fb..9eff3d751c6b 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
****************************************************************/
-const char *version = "version 20110501";
+const char *version = "version 20110506";
#define DEBUG
#include <stdio.h>
@@ -91,13 +91,18 @@ int main(int argc, char *argv[])
safe = 1;
break;
case 'f': /* next argument is program filename */
- argc--;
- argv++;
- if (argc <= 1)
- FATAL("no program filename");
- if (npfile >= MAX_PFILE - 1)
- FATAL("too many -f options");
- pfile[npfile++] = argv[1];
+ if (argv[1][2] != 0) { /* arg is -fsomething */
+ if (npfile >= MAX_PFILE - 1)
+ FATAL("too many -f options");
+ pfile[npfile++] = &argv[1][2];
+ } else { /* arg is -f something */
+ argc--; argv++;
+ if (argc <= 1)
+ FATAL("no program filename");
+ if (npfile >= MAX_PFILE - 1)
+ FATAL("too many -f options");
+ pfile[npfile++] = argv[1];
+ }
break;
case 'F': /* set field separator */
if (argv[1][2] != 0) { /* arg is -Fsomething */