cccp.c (main): Trim down to the basename of what's to go in PROGNAME.
authorBrendan Kehoe <brendan@gcc.gnu.org>
Fri, 15 Jan 1993 00:19:10 +0000 (19:19 -0500)
committerBrendan Kehoe <brendan@gcc.gnu.org>
Fri, 15 Jan 1993 00:19:10 +0000 (19:19 -0500)
        * cccp.c (main): Trim down to the basename of what's to go in
        PROGNAME.

From-SVN: r3248

gcc/cccp.c

index dd2dca521a15eb087deacd45bd79e80c6d171e14..6a7eb59f64705eaaeace0f09724ee200de7aa4ac 100644 (file)
@@ -989,7 +989,10 @@ main (argc, argv)
 
   signal (SIGPIPE, pipe_closed);
 
-  progname = argv[0];
+  p = argv[0] + strlen (argv[0]);
+  while (p != argv[0] && p[-1] != '/') --p;
+  progname = p;
+
 #ifdef VMS
   {
     /* Remove directories from PROGNAME.  */