summaryrefslogtreecommitdiff
path: root/lib/depcomp
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2012-10-18 14:45:21 +0200
committerStefano Lattarini <stefano.lattarini@gmail.com>2012-11-24 15:52:42 +0100
commit83cc9fd054566db15736c07c0a46c288d28082c2 (patch)
tree012ca63467529d4201d3c32fe594fe2a28721d66 /lib/depcomp
parent5d3b980bd2b63733a98f626e5f23c5c9661cc3cc (diff)
downloadautomake-83cc9fd054566db15736c07c0a46c288d28082c2.tar.gz
depcomp: avoid an extra fork when possible
* lib/depcomp (set_dir_from): Here. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/depcomp')
-rwxr-xr-xlib/depcomp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/depcomp b/lib/depcomp
index 17075862e..23a9fcb3c 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