=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/make/main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -c -r1.60 -r1.61 *** src/usr.bin/make/main.c 2003/04/06 22:47:14 1.60 --- src/usr.bin/make/main.c 2003/04/21 23:14:06 1.61 *************** *** 1,5 **** /* $OpenPackages$ */ ! /* $OpenBSD: main.c,v 1.60 2003/04/06 22:47:14 espie Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* --- 1,5 ---- /* $OpenPackages$ */ ! /* $OpenBSD: main.c,v 1.61 2003/04/21 23:14:06 millert Exp $ */ /* $NetBSD: main.c,v 1.34 1997/03/24 20:56:36 gwr Exp $ */ /* *************** *** 194,202 **** int argc; char **argv; { ! extern int optind; ! extern char *optarg; ! int c; int forceJobs = 0; #define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" --- 194,200 ---- int argc; char **argv; { ! int c, optend; int forceJobs = 0; #define OPTFLAGS "BD:I:PSV:d:ef:ij:km:nqrst" *************** *** 204,211 **** optind = 1; /* since we're called more than once */ optreset = 1; while (optind < argc) { ! switch (c = getopt(argc, argv, OPTFLAGS)) { case 'D': Var_Set(optarg, "1", VAR_GLOBAL); record_option(c, optarg); --- 202,220 ---- optind = 1; /* since we're called more than once */ optreset = 1; + optend = 0; while (optind < argc) { ! if (!optend && argv[optind][0] == '-') { ! if (argv[optind][1] == '\0') ! optind++; /* ignore "-" */ ! else if (argv[optind][1] == '-' && ! argv[optind][2] == '\0') { ! optind++; /* ignore "--" */ ! optend++; /* "--" denotes end of flags */ ! } ! } ! c = optend ? -1 : getopt(argc, argv, OPTFLAGS); ! switch (c) { case 'D': Var_Set(optarg, "1", VAR_GLOBAL); record_option(c, optarg); *************** *** 304,311 **** !Parse_DoVar(argv[optind], VAR_CMD)) { if (!*argv[optind]) Punt("illegal (null) argument."); ! if (strcmp(argv[optind], "-") != 0) ! Lst_AtEnd(create, estrdup(argv[optind])); } optind++; /* skip over non-option */ break; --- 313,319 ---- !Parse_DoVar(argv[optind], VAR_CMD)) { if (!*argv[optind]) Punt("illegal (null) argument."); ! Lst_AtEnd(create, estrdup(argv[optind])); } optind++; /* skip over non-option */ break;