public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] sim: simplify STATE_MY_NAME setup [committed]
Date: Wed, 30 Dec 2015 08:36:00 -0000	[thread overview]
Message-ID: <1451464601-3483-1-git-send-email-vapier@gentoo.org> (raw)

No point in writing basename ourselves when libiberty provides one.
---
 sim/common/ChangeLog    | 5 +++++
 sim/common/sim-module.c | 4 +---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index ae94846..58ffa6c 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-30  Mike Frysinger  <vapier@gentoo.org>
+
+	* sim-module.c (sim_pre_argv_init): Change STATE_MY_NAME assignment
+	to use lbasename.
+
 2015-12-27  Mike Frysinger  <vapier@gentoo.org>
 
 	* Makefile.in (SIM_NEW_COMMON_OBJS): Add sim-hload.o.
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index 3d49f57..33f5740 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -74,9 +74,7 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname)
   SIM_ASSERT (STATE_MAGIC (sd) == SIM_MAGIC_NUMBER);
   SIM_ASSERT (STATE_MODULES (sd) == NULL);
 
-  STATE_MY_NAME (sd) = myname + strlen (myname);
-  while (STATE_MY_NAME (sd) > myname && STATE_MY_NAME (sd)[-1] != '/')
-    --STATE_MY_NAME (sd);
+  STATE_MY_NAME (sd) = lbasename (myname);
 
   /* Set the cpu names to default values.  */
   {
-- 
2.6.2

                 reply	other threads:[~2015-12-30  8:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451464601-3483-1-git-send-email-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).