* fork-child.c (fork_inferior): Only quote exec file if needed.
* mipsread.c (parse_symbol): Remove 21 Jul 93 change with stTypedef inside an stBlock.
This commit is contained in:
parent
4e95866e2c
commit
38bbfd3795
|
@ -97,20 +97,58 @@ fork_inferior (exec_file, allargs, env, traceme_fun, init_trace_fun)
|
||||||
#endif
|
#endif
|
||||||
strcat (shell_command, "exec ");
|
strcat (shell_command, "exec ");
|
||||||
|
|
||||||
/* Now add exec_file, quoting as necessary. Quoting in this style is
|
/* Now add exec_file, quoting as necessary. */
|
||||||
said to work with all shells. */
|
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
|
int need_to_quote;
|
||||||
|
|
||||||
strcat (shell_command, "'");
|
/* Quoting in this style is said to work with all shells. But csh
|
||||||
for (p = exec_file; *p != '\0'; ++p)
|
on IRIX 4.0.1 can't deal with it. So we only quote it if we need
|
||||||
|
to. */
|
||||||
|
p = exec_file;
|
||||||
|
while (1)
|
||||||
{
|
{
|
||||||
if (*p == '\'')
|
switch (*p)
|
||||||
strcat (shell_command, "'\\''");
|
{
|
||||||
else
|
case '\'':
|
||||||
strncat (shell_command, p, 1);
|
case '"':
|
||||||
|
case '(':
|
||||||
|
case ')':
|
||||||
|
case '$':
|
||||||
|
case '&':
|
||||||
|
case ';':
|
||||||
|
case '<':
|
||||||
|
case '>':
|
||||||
|
case ' ':
|
||||||
|
case '\n':
|
||||||
|
case '\t':
|
||||||
|
need_to_quote = 1;
|
||||||
|
goto end_scan;
|
||||||
|
|
||||||
|
case '\0':
|
||||||
|
need_to_quote = 0;
|
||||||
|
goto end_scan;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
++p;
|
||||||
}
|
}
|
||||||
strcat (shell_command, "'");
|
end_scan:
|
||||||
|
if (need_to_quote)
|
||||||
|
{
|
||||||
|
strcat (shell_command, "'");
|
||||||
|
for (p = exec_file; *p != '\0'; ++p)
|
||||||
|
{
|
||||||
|
if (*p == '\'')
|
||||||
|
strcat (shell_command, "'\\''");
|
||||||
|
else
|
||||||
|
strncat (shell_command, p, 1);
|
||||||
|
}
|
||||||
|
strcat (shell_command, "'");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
strcat (shell_command, exec_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
strcat (shell_command, " ");
|
strcat (shell_command, " ");
|
||||||
|
|
|
@ -954,6 +954,10 @@ parse_symbol (sh, ax, ext_sh, bigend)
|
||||||
max_value = tsym.value;
|
max_value = tsym.value;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* This does not fix the bug which it intended to fix,
|
||||||
|
and makes GDB hang when reading its own symbol table on
|
||||||
|
the SGI, when compiled with the SGI compiler. */
|
||||||
case stTypedef:
|
case stTypedef:
|
||||||
case stConstant:
|
case stConstant:
|
||||||
case stStaticProc:
|
case stStaticProc:
|
||||||
|
@ -962,6 +966,7 @@ parse_symbol (sh, ax, ext_sh, bigend)
|
||||||
Apparently processing them like the following prevents
|
Apparently processing them like the following prevents
|
||||||
core dumps. */
|
core dumps. */
|
||||||
/* FALLTHROUGH */
|
/* FALLTHROUGH */
|
||||||
|
#endif
|
||||||
|
|
||||||
case stBlock:
|
case stBlock:
|
||||||
case stUnion:
|
case stUnion:
|
||||||
|
|
Loading…
Reference in New Issue