43 |
|
/* build our command */ |
44 |
|
for (cp = newcmd; ; cmd++) { |
45 |
|
switch (*cmd) { |
46 |
– |
case '"': |
46 |
|
case '\'': |
47 |
+ |
case '"': |
48 |
|
if (!quote) |
49 |
|
quote = *cmd; |
50 |
|
else if (quote == *cmd) |
51 |
|
quote = '\0'; |
52 |
+ |
#ifdef MSDOS |
53 |
+ |
else |
54 |
+ |
break; |
55 |
+ |
*cp++ = '"'; /* double quotes only */ |
56 |
+ |
continue; |
57 |
+ |
#else |
58 |
|
break; |
59 |
+ |
#endif |
60 |
+ |
#ifndef MSDOS |
61 |
|
case '(': |
62 |
|
if (!quote) |
63 |
|
paren++; |
74 |
|
} |
75 |
|
*cp++ = *cmd++; |
76 |
|
break; |
77 |
+ |
#endif |
78 |
+ |
case ' ': |
79 |
+ |
case '\t': |
80 |
+ |
if (!quote) |
81 |
+ |
while (isspace(cmd[1])) |
82 |
+ |
cmd++; |
83 |
+ |
break; |
84 |
|
case '|': |
85 |
|
case ';': |
86 |
|
if (!quote && !paren && cp2 == NULL) |
117 |
|
return(NULL); |
118 |
|
} |
119 |
|
if (fileno(fp) >= NFILE) { |
120 |
< |
fputs("popen: too many open files\n", stderr); |
121 |
< |
exit(1); |
120 |
> |
eputs("popen: too many open files\n"); |
121 |
> |
quit(1); |
122 |
|
} |
123 |
|
pips[fileno(fp)].f = fname; |
124 |
|
if (*mode == 'r') { |