libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cwrapper: avoid duplicate strlen calculation.


From: Bob Friesenhahn
Subject: Re: [PATCH] cwrapper: avoid duplicate strlen calculation.
Date: Mon, 30 Jan 2012 11:11:09 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Mon, 30 Jan 2012, Peter Rosin wrote:

[Sorry for replying to myself]

I do that often.

* build-aux/ltmain.m4sh (func_emit_cwrapperexe_src:lt_update_exe_path):
Remove duplicate strlen calculation.

Hmmm, I like the following better, so I'm going to push that instead,
in case of silence.

Why wait?  Your patch looks fine to apply to me.

Bob


Cheers,
Peter

From 7b945cfdaaad8a87a19fcf837dd4bc04f399b1ab Mon Sep 17 00:00:00 2001
From: Peter Rosin <address@hidden>
Date: Mon, 30 Jan 2012 15:49:05 +0100
Subject: [PATCH] cwrapper: avoid surplus strlen calculations.

* build-aux/ltmain.m4sh (func_emit_cwrapperexe_src:lt_update_exe_path):
Avoid surplus strlen calculations.

Signed-off-by: Peter Rosin <address@hidden>
---
build-aux/ltmain.m4sh |    4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/build-aux/ltmain.m4sh b/build-aux/ltmain.m4sh
index 922e957..00d063c 100644
--- a/build-aux/ltmain.m4sh
+++ b/build-aux/ltmain.m4sh
@@ -4151,9 +4151,9 @@ lt_update_exe_path (const char *name, const char *value)
      char *new_value = lt_extend_str (getenv (name), value, 0);
      /* some systems can't cope with a ':'-terminated path #' */
      int len = strlen (new_value);
-      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR 
(new_value[len-1]))
+      while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
        {
-          new_value[len-1] = '\0';
+          new_value[--len] = '\0';
        }
      lt_setenv (name, new_value);
      XFREE (new_value);


--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]