mflag: add: skip leading whitespace

pull/12/head
Leah Neukirchen 8 years ago
parent e31cd95dc2
commit c561aca4c9

@ -26,16 +26,18 @@ char *curfile;
void void
add(char *file) add(char *file)
{ {
if (idx >= argsalloc) { if (idx >= argsalloc) {
argsalloc *= 2; argsalloc *= 2;
if (argsalloc < 0) if (argsalloc < 0)
exit(-1); exit(-1);
args = realloc(args, sizeof (char *) * argsalloc); args = realloc(args, sizeof (char *) * argsalloc);
} }
if (!args) if (!args)
exit(-1); exit(-1);
args[idx] = strdup(file); while (*file == ' ' || *file == '\t')
idx++; file++;
args[idx] = strdup(file);
idx++;
} }
void void

Loading…
Cancel
Save