[Top][All Lists]
[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
- [RFC 01/20] depcomp: be more idiomatic in checking for zero exit statuses, (continued)
- [RFC 01/20] depcomp: be more idiomatic in checking for zero exit statuses, Stefano Lattarini, 2012/10/18
- [RFC 02/20] depcomp: remove useless quoting in variable definitions, Stefano Lattarini, 2012/10/18
- [RFC 03/20] depcomp: use "rmdir", not "rm -rf", to remove the empty lock directory, Stefano Lattarini, 2012/10/18
- [RFC 04/20] depcomp: correctly propagate exit status in exit trap, Stefano Lattarini, 2012/10/18
- [RFC 05/20] depcomp: safer quoting in variable expansion, Stefano Lattarini, 2012/10/18
- [RFC 06/20] depcomp: cosmetic fixlets to a comment, Stefano Lattarini, 2012/10/18
- [RFC 07/20] depcomp: don't rely on character ranges working as in C locale, Stefano Lattarini, 2012/10/18
- [RFC 08/20] depcomp: reduce code duplication, Stefano Lattarini, 2012/10/18
- [RFC 09/20] depcomp: avoid an extra fork when possible,
Stefano Lattarini <=
- [RFC 10/20] depcomp: less duplication between AIX and Tru64 modes, Stefano Lattarini, 2012/10/18
- [RFC 11/20] depcomp: make some code more self-documenting, Stefano Lattarini, 2012/10/18
- [RFC 12/20] depcomp: shell code style changes, Stefano Lattarini, 2012/10/18
- [RFC 15/20] depcomp: remove an unused variable, Stefano Lattarini, 2012/10/18
- [RFC 14/20] depcomp: rewrite a sed invocation for less quoting, Stefano Lattarini, 2012/10/18
- [RFC 13/20] depcomp: whitespace fixes, Stefano Lattarini, 2012/10/18
- [RFC 17/20] depcomp: improve comments about tcc support, Stefano Lattarini, 2012/10/18
- [RFC 18/20] tests: fix spurious failures with tcc, Stefano Lattarini, 2012/10/18
- [RFC 16/20] depcomp: remove last relics of libtool 1.4 support, Stefano Lattarini, 2012/10/18
- [RFC 19/20] NEWS: update w.r.t. recent depcomp changes, Stefano Lattarini, 2012/10/18