[PATCH 1/2] Windows libibery: Don't quote args unnecessarily
Eli Zaretskii
eliz@gnu.org
Sun Apr 20 06:07:00 GMT 2014
> Date: Sat, 19 Apr 2014 16:23:33 -0400 (EDT)
> From: Kai Tietz <ktietz@redhat.com>
> Cc: gcc-patches@gcc.gnu.org, ktietz70@gmail.com, "binutils@sourceware.org Development" <binutils@sourceware.org>, gdb-patches@sourceware.org
>
> > + /* We only quote arguments that contain spaces, \n \t \v or " characters
> > + to prevent wasting 2 chars per argument of the CreateProcess 32k char
> > + limit We need only escape embedded double-quotes and immediately
> > preceeding backslash characters. A sequence of backslach characters
> > that is not follwed by a double quote character will not be
> > escaped. */
> > + needs_quotes = 0;
> > for (j = 0; argv[i][j]; j++)
> > {
> > + if (argv[i][j] == ' ' || argv[i][j] == '\n' ||
> > + argv[i][j] == '\t' || argv[i][j] == '"' )
> > + {
> Here seems to be an intend issue.
> > + needs_quotes = 1;
> > + }
I think you can omit the \n case, since command arguments on Windows
cannot possibly include newlines. Also, the comment speaks about \v,
but I see no code to handle that (and am not sure you should bother in
that case as well).
> Patch itself makes sense.
Yes, I agree.
More information about the Binutils
mailing list