From: Jim Wilson Date: Tue, 2 Mar 1993 21:19:37 +0000 (-0800) Subject: (main): Truncate programname to what is after last slash. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=afcd8a020f2737574abea7d3971656621bde559c;p=gcc.git (main): Truncate programname to what is after last slash. From-SVN: r3612 --- diff --git a/gcc/gcc.c b/gcc/gcc.c index 5886e488d5e..61895212941 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3373,8 +3373,11 @@ main (argc, argv) int linker_was_run = 0; char *explicit_link_files; char *specs_file; + char *p; - programname = argv[0]; + p = argv[0] + strlen (argv[0]); + while (p != argv[0] && p[-1] != '/') --p; + programname = p; if (signal (SIGINT, SIG_IGN) != SIG_IGN) signal (SIGINT, fatal_error);