46 lines
1.2 KiB
Text
46 lines
1.2 KiB
Text
$NetBSD: patch-ac,v 1.1.1.1 2001/07/21 02:51:36 gmcgarry Exp $
|
|
--- etc/lcc.c.orig Tue Aug 22 19:56:56 2000
|
|
+++ etc/lcc.c Tue Aug 22 21:24:43 2000
|
|
@@ -552,6 +552,20 @@
|
|
exit(n = 100);
|
|
}
|
|
|
|
+/* parse -W[alp] argument, splitting at commas, a la gcc */
|
|
+static List wappend (char *warg, List lst) {
|
|
+ if (*warg != ',') return append (warg, lst);
|
|
+ warg++;
|
|
+ do {
|
|
+ char *s = warg;
|
|
+ for (; *warg && *warg != ','; warg++)
|
|
+ ;
|
|
+ if (*warg) *warg++= '\0';
|
|
+ if (*s) lst = append (s, lst);
|
|
+ } while (*warg);
|
|
+ return lst;
|
|
+}
|
|
+
|
|
/* opt - process option in arg */
|
|
static void opt(char *arg) {
|
|
switch (arg[1]) { /* multi-character options */
|
|
@@ -563,7 +577,7 @@
|
|
return;
|
|
break;
|
|
case 'p':
|
|
- plist = append(&arg[3], plist);
|
|
+ plist = wappend(&arg[3], plist);
|
|
return;
|
|
case 'f':
|
|
if (strcmp(&arg[3], "-C") || option("-b")) {
|
|
@@ -572,10 +586,10 @@
|
|
}
|
|
break; /* and fall thru */
|
|
case 'a':
|
|
- alist = append(&arg[3], alist);
|
|
+ alist = wappend(&arg[3], alist);
|
|
return;
|
|
case 'l':
|
|
- llist[0] = append(&arg[3], llist[0]);
|
|
+ llist[0] = wappend(&arg[3], llist[0]);
|
|
return;
|
|
}
|
|
fprintf(stderr, "%s: %s ignored\n", progname, arg);
|