automake-patches
[Top][All Lists]
Advanced

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

[RFC 09/20] depcomp: avoid an extra fork when possible


From: Stefano Lattarini
Subject: [RFC 09/20] depcomp: avoid an extra fork when possible
Date: Thu, 18 Oct 2012 22:40:43 +0200

* lib/depcomp (set_dir_from): Here.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 lib/depcomp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/depcomp b/lib/depcomp
index e36858a..7325cc9 100755
--- a/lib/depcomp
+++ b/lib/depcomp
@@ -61,8 +61,10 @@ esac
 # be either empty or ending with a '/' character.  This is deliberate.
 set_dir_from ()
 {
-  dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`
-  test "x$dir" = "x$1" && dir=
+  case $1 in
+    */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
+      *) dir=;;
+  esac
 }
 
 # Get the suffix-stripped basename of the given path, and save it the
-- 
1.8.0.rc2.11.gd25c58c




reply via email to

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