From: Stefano Lattarini Date: Thu, 18 Oct 2012 12:45:21 +0000 (+0200) Subject: depcomp: avoid an extra fork when possible X-Git-Tag: v1.12b~13^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83cc9fd054566db15736c07c0a46c288d28082c2;p=thirdparty%2Fautomake.git depcomp: avoid an extra fork when possible * lib/depcomp (set_dir_from): Here. Signed-off-by: Stefano Lattarini --- 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