diff options
author | Jim Meyering <jim@meyering.net> | 2003-09-28 12:38:38 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2003-09-28 12:38:38 +0000 |
commit | a981c15fd24f621312760a4cd835193c00b05787 (patch) | |
tree | 163ecf6f5f919d9ef31c08e93dcf626595662078 /config/install-sh | |
parent | cc0d2177860c23b29f42640eb36db8c5ac0d63a5 (diff) | |
download | coreutils-a981c15fd24f621312760a4cd835193c00b05787.tar.xz |
.
Diffstat (limited to 'config/install-sh')
-rwxr-xr-x | config/install-sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/config/install-sh b/config/install-sh index 2c1f8777b..f5061e7e2 100755 --- a/config/install-sh +++ b/config/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2003-06-13.21 +scriptversion=2003-09-24.23 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -151,6 +151,11 @@ if test -z "$src"; then exit 1 fi +# Protect names starting with `-'. +case $src in + -*) src=./$src ;; +esac + if test -n "$dir_arg"; then dst=$src src= @@ -175,6 +180,11 @@ else exit 1 fi + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst ;; + esac + # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then @@ -182,11 +192,10 @@ else fi fi -## this sed command emulates the dirname command +# This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. -# (this part is taken from Noah Friedman's mkinstalldirs script.) # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then |