diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-30 22:12:39 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-12-30 22:12:39 +0000 |
commit | 16cc00016247c61e970f5212e548e183d2920670 (patch) | |
tree | 4c997bec9e32bbca5650bf3c59ebb916a6739301 /usr.bin/make/main.c | |
parent | 2622aabf199bc79809a1ebc2f1c54a3af40af336 (diff) |
Don't pass a NULL arg to Parse_DoVar which can happen if user specifies
"make --".
Check for "-", not "--" when deciding whether or not to pass something
to Lst_AtEnd() (I misunderstood what the old code was trying to do).
This fixes, e.g. ports/graphics/tiff
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r-- | usr.bin/make/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c index 8eac479d234..8e288b22f6d 100644 --- a/usr.bin/make/main.c +++ b/usr.bin/make/main.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: main.c,v 1.58 2002/12/30 02:29:24 millert Exp $ */ +/* $OpenBSD: main.c,v 1.59 2002/12/30 22:12:38 millert Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* @@ -300,10 +300,11 @@ MainParseArgs(argc, argv) break; case -1: /* Check for variable assignments and targets. */ - if (!Parse_DoVar(argv[optind], VAR_CMD)) { + if (argv[optind] != NULL && + !Parse_DoVar(argv[optind], VAR_CMD)) { if (!*argv[optind]) Punt("illegal (null) argument."); - if (strcmp(argv[optind], "--") != 0) + if (strcmp(argv[optind], "-") != 0) Lst_AtEnd(create, estrdup(argv[optind])); } optind++; /* skip over non-option */ |