Only use space and tab to separate arguments (as Bash does), not all whitespace.
(^K
is entered as Ctrl+K and output as the literal character.)
T:\>cat test.c #include <stdio.h> int main(int argc, char** argv) { puts(argv[1]); } T:\>gcc test.c -s -o old.exe T:\>gcc test.c -s -o new.exe -Lmingwrt-3.22.4-1 T:\>old a^Kb a T:\>new a^Kb a^Kb
Once again, what bash does is not authoritatively definitive of any standard behaviour; you need to cite the appropriate POSIX reference documentation.
On balance, I think you may be right; POSIX shells should split argument fields at
IFS
characters, (which by default areSPC
,HT
, andLF
). This begs the question: shouldsetargv()
consider any other characters which may have been added toIFS
? The POSIX standard doesn't make this particularly clear, but I don't know of any supposedly POSIX compliant shell which uses anything other than defaultIFS-whitespace
, except when performing word-splitting of command substituted, or shell/environment variable substituted arguments, so perhaps not.I'd rather not have
LF
as a delimiter, as that's the character that caused me to make the patch in the first place (GLOBAL's ctags plugin stopped working, which I eventually tracked down toLF
becoming a separator, which neither MSVC nor mingw-w64 do, although it seems Cygwin does; admittedly, I should quote it anyway).I've experimented with various shells, on my LMDE box, and can only get IFS word splitting when substituting command output or shell/environment variables; in all other cases, only the ISO-C99 ctype isblank characters serve as argument separators. LF always serves as a command terminator, unless quoted or embedded within one of the afore-mentioned substitutions; (in the latter case it does serve as IFS-whitespace). Consequently, I committed [888d2e], as an alternative to your patch; please confirm if this is satisfactory.
Related
Commit: [888d2e]
Quite satisfactory, thank you.