Commit 09b201fc by Jakub Jelinek Committed by Jakub Jelinek

gcc.c (execute): For -### don't quote arguments that contain just alphanumerics and _/-.

	* gcc.c (execute): For -### don't quote arguments that
	contain just alphanumerics and _/-. characters.
	* doc/invoke.texi: Document that change for -###.

From-SVN: r159255
parent 3f592b38
2010-05-11 Jakub Jelinek <jakub@redhat.com> 2010-05-11 Jakub Jelinek <jakub@redhat.com>
* gcc.c (execute): For -### don't quote arguments that
contain just alphanumerics and _/-. characters.
* doc/invoke.texi: Document that change for -###.
PR debug/44023 PR debug/44023
* df-problems.c (struct dead_debug): Add to_rescan field. * df-problems.c (struct dead_debug): Add to_rescan field.
(dead_debug_init): Clear to_rescan field. (dead_debug_init): Clear to_rescan field.
......
...@@ -1172,9 +1172,9 @@ program and of the preprocessor and the compiler proper. ...@@ -1172,9 +1172,9 @@ program and of the preprocessor and the compiler proper.
@item -### @item -###
@opindex ### @opindex ###
Like @option{-v} except the commands are not executed and all command Like @option{-v} except the commands are not executed and arguments
arguments are quoted. This is useful for shell scripts to capture the are quoted unless they contain only alphanumeric characters or @code{./-_}.
driver-generated command lines. This is useful for shell scripts to capture the driver-generated command lines.
@item -pipe @item -pipe
@opindex pipe @opindex pipe
......
...@@ -3020,6 +3020,12 @@ execute (void) ...@@ -3020,6 +3020,12 @@ execute (void)
for (j = commands[i].argv; *j; j++) for (j = commands[i].argv; *j; j++)
{ {
const char *p; const char *p;
for (p = *j; *p; ++p)
if (!ISALNUM ((unsigned char) *p)
&& *p != '_' && *p != '/' && *p != '-' && *p != '.')
break;
if (*p || !*j)
{
fprintf (stderr, " \""); fprintf (stderr, " \"");
for (p = *j; *p; ++p) for (p = *j; *p; ++p)
{ {
...@@ -3029,6 +3035,9 @@ execute (void) ...@@ -3029,6 +3035,9 @@ execute (void)
} }
fputc ('"', stderr); fputc ('"', stderr);
} }
else
fprintf (stderr, " %s", *j);
}
} }
else else
for (j = commands[i].argv; *j; j++) for (j = commands[i].argv; *j; j++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment