From: Richard Kenner Date: Mon, 13 Feb 1995 11:50:13 +0000 (-0500) Subject: (main): Look at DIR_SEPARATOR for finding last component. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=128373acacc776a33747e3edf41297a701dc0e98;p=gcc.git (main): Look at DIR_SEPARATOR for finding last component. From-SVN: r8916 --- diff --git a/gcc/toplev.c b/gcc/toplev.c index 7c5cd7b6dc3..8d4a8c42119 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