Properly handle invalid arguments in builtins

Fixes #1522
This commit is contained in:
Siteshwar Vashisht 2014-07-02 17:04:58 +05:30
parent 14cdd24f78
commit 7d47ec4c46

View file

@ -638,7 +638,10 @@ _wgetopt_internal(int argc, wchar_t *const *argv, const wchar_t *optstring, cons
fwprintf(stderr, _(L"%ls: Invalid option -- %lc\n"), argv[0], c);
}
woptopt = c;
if (*nextchar != '\0')
woptind++;
return '?';
}
if (temp[1] == ':')