diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1995-02-13 06:50:13 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1995-02-13 06:50:13 -0500 |
commit | 128373acacc776a33747e3edf41297a701dc0e98 (patch) | |
tree | 7b614677ce920d57ebdc56a42403e2df213179d3 | |
parent | fe7cdaaac690e962c82a441c1a4df3e43fa47987 (diff) | |
download | gcc-128373acacc776a33747e3edf41297a701dc0e98.zip gcc-128373acacc776a33747e3edf41297a701dc0e98.tar.gz gcc-128373acacc776a33747e3edf41297a701dc0e98.tar.bz2 |
(main): Look at DIR_SEPARATOR for finding last component.
From-SVN: r8916
-rw-r--r-- | gcc/toplev.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 7c5cd7b..8d4a8c4 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1,5 +1,5 @@ /* Top level of GNU C compiler - Copyright (C) 1987, 88, 89, 92, 93, 1994 Free Software Foundation, Inc. + Copyright (C) 1987, 88, 89, 92, 93, 94, 1995 Free Software Foundation, Inc. This file is part of GNU CC. @@ -3366,7 +3366,12 @@ main (argc, argv, envp) save_argv = argv; p = argv[0] + strlen (argv[0]); - while (p != argv[0] && p[-1] != '/') --p; + while (p != argv[0] && p[-1] != '/' +#ifdef DIR_SEPARATOR + && p[-1] != DIR_SEPARATOR +#endif + ) + --p; progname = p; #ifdef RLIMIT_STACK |