gas: sparc: fix collision of registers and pseudo-ops.
[deliverable/binutils-gdb.git] / sim / common / nrun.c
index 2e477153022a873c8e4ade1da8f1d5796983f6b2..6616cc1d1e470a77ebbed46885d9f0cd023ae1b3 100644 (file)
@@ -16,7 +16,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 /* Need to be before general includes, to pick up e.g. _GNU_SOURCE.  */
 #ifdef HAVE_CONFIG_H
-#include "cconfig.h"
+#include "config.h"
 #endif
 
 #include <signal.h>
@@ -47,7 +47,7 @@ static void usage (void);
 
 extern host_callback default_callback;
 
-static char *myname;
+static const char *myname;
 
 static SIM_DESC sd;
 
@@ -64,7 +64,7 @@ cntrl_c (int sig)
 int
 main (int argc, char **argv)
 {
-  char *name;
+  const char *name;
   char **prog_argv = NULL;
   struct bfd *prog_bfd;
   enum sim_stop reason;
@@ -72,9 +72,7 @@ main (int argc, char **argv)
   int single_step = 0;
   RETSIGTYPE (*prev_sigint) ();
 
-  myname = argv[0] + strlen (argv[0]);
-  while (myname > argv[0] && myname[-1] != '/')
-    --myname;
+  myname = lbasename (argv[0]);
 
   /* INTERNAL: When MYNAME is `step', single step the simulator
      instead of allowing it to run free.  The sole purpose of this
This page took 0.023954 seconds and 4 git commands to generate.