]> gcc.gnu.org Git - gcc.git/commitdiff
gen-protos.c (progname): New variable (needed by cppalloc.c).
authorPer Bothner <bothner@gcc.gnu.org>
Fri, 7 Jun 1996 18:59:34 +0000 (11:59 -0700)
committerPer Bothner <bothner@gcc.gnu.org>
Fri, 7 Jun 1996 18:59:34 +0000 (11:59 -0700)
* gen-protos.c (progname):  New variable (needed by cppalloc.c).
(main):  Set progname.

From-SVN: r12212

gcc/gen-protos.c

index 44c900ae0a6ef75f512eb19ad670fb5f563484d4..ede40e3d6c9972d0e619b561fc74e882f437cb9a 100644 (file)
@@ -40,6 +40,7 @@ hashf (name, len, hashsize)
 
 int hash_tab[HASH_SIZE];
 int verbose = 0;
+char *progname;
 
 sstring linebuf;
 
@@ -63,6 +64,10 @@ main (argc, argv)
   int next_index = 0;
   int i, i0;
 
+  i = strlen (argv[0]);
+  while (i > 0 && argv[i-1] != '/') --i;
+  progname = &argv[i];
+
   fprintf (outf, "struct fn_decl std_protos[] = {\n");
 
   for (;;)
This page took 0.062434 seconds and 5 git commands to generate.