aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-08-04 03:57:21 +0000
committerRichard Stallman <rms@gnu.org>1993-08-04 03:57:21 +0000
commit14553b75690c42391b53a9b07374825d0ce5072f (patch)
treeef4333de1678746e605f60b1e566bdb56c711892
parent1c66daf534311d974c2e49c14a59b88412d58763 (diff)
downloadgcc-14553b75690c42391b53a9b07374825d0ce5072f.zip
gcc-14553b75690c42391b53a9b07374825d0ce5072f.tar.gz
gcc-14553b75690c42391b53a9b07374825d0ce5072f.tar.bz2
(process_command): Don't check whether file `-' exists.
From-SVN: r5066
-rw-r--r--gcc/gcc.c52
1 files changed, 29 insertions, 23 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 72fe68d..1c17bb9 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2508,31 +2508,36 @@ process_command (argc, argv)
switches[n_switches].part1 = p;
/* Deal with option arguments in separate argv elements. */
if ((SWITCH_TAKES_ARG (c) > (p[1] != 0))
- || WORD_SWITCH_TAKES_ARG (p)) {
- int j = 0;
- int n_args = WORD_SWITCH_TAKES_ARG (p);
+ || WORD_SWITCH_TAKES_ARG (p))
+ {
+ int j = 0;
+ int n_args = WORD_SWITCH_TAKES_ARG (p);
- if (n_args == 0) {
- /* Count only the option arguments in separate argv elements. */
- n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
+ if (n_args == 0)
+ {
+ /* Count only the option arguments in separate argv elements. */
+ n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
+ }
+ if (i + n_args >= argc)
+ fatal ("argument to `-%s' is missing", p);
+ switches[n_switches].args
+ = (char **) xmalloc ((n_args + 1) * sizeof (char *));
+ while (j < n_args)
+ switches[n_switches].args[j++] = argv[++i];
+ /* Null-terminate the vector. */
+ switches[n_switches].args[j] = 0;
}
- if (i + n_args >= argc)
- fatal ("argument to `-%s' is missing", p);
- switches[n_switches].args
- = (char **) xmalloc ((n_args + 1) * sizeof (char *));
- while (j < n_args)
- switches[n_switches].args[j++] = argv[++i];
- /* Null-terminate the vector. */
- switches[n_switches].args[j] = 0;
- } else if (*switches_need_spaces != 0 && (c == 'o' || c == 'L')) {
- /* On some systems, ld cannot handle -o or -L without space.
- So split the -o or -L from its argument. */
- switches[n_switches].part1 = (c == 'o' ? "o" : "L");
- switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *));
- switches[n_switches].args[0] = xmalloc (strlen (p));
- strcpy (switches[n_switches].args[0], &p[1]);
- switches[n_switches].args[1] = 0;
- } else
+ else if (*switches_need_spaces != 0 && (c == 'o' || c == 'L'))
+ {
+ /* On some systems, ld cannot handle -o or -L without space.
+ So split the -o or -L from its argument. */
+ switches[n_switches].part1 = (c == 'o' ? "o" : "L");
+ switches[n_switches].args = (char **) xmalloc (2 * sizeof (char *));
+ switches[n_switches].args[0] = xmalloc (strlen (p));
+ strcpy (switches[n_switches].args[0], &p[1]);
+ switches[n_switches].args[1] = 0;
+ }
+ else
switches[n_switches].args = 0;
switches[n_switches].valid = 0;
/* This is always valid, since gcc.c itself understands it. */
@@ -2543,6 +2548,7 @@ process_command (argc, argv)
else
{
if ((argv[i][0] != '-' || argv[i][1] != 'l')
+ && strcmp (argv[i], "-")
&& access (argv[i], R_OK) < 0)
{
perror_with_name (argv[i]);