(main): Truncate programname to what is after last slash.
authorJim Wilson <wilson@gcc.gnu.org>
Tue, 2 Mar 1993 21:19:37 +0000 (13:19 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Tue, 2 Mar 1993 21:19:37 +0000 (13:19 -0800)
From-SVN: r3612

gcc/gcc.c

index 5886e488d5ee6b02eecd85b1bbcd0d2214198ae5..61895212941e7b6c14822e9828c5442b8320860a 100644 (file)
--- 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);