]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
* lib/install-sh (src, dst): Protect names starting with `-',
authorAlexandre Duret-Lutz <adl@gnu.org>
Wed, 24 Sep 2003 21:57:26 +0000 (21:57 +0000)
committerAlexandre Duret-Lutz <adl@gnu.org>
Wed, 24 Sep 2003 21:57:26 +0000 (21:57 +0000)
as in mkinstalldirs.

ChangeLog
lib/install-sh

index 4c4bf2741da34e8a06c491f138959aa92fc93a4f..459f6a6e36a819c9ef8aa23109ce554bca167e5d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2003-09-24  Alexandre Duret-Lutz  <adl@gnu.org>
 
+       * lib/install-sh (src, dst): Protect names starting with `-',
+       as in mkinstalldirs.
+
        * configure.in: Rename as ...
        * configure.ac: ... this.
        * README: s/configure.in/configure.ac/.
index 2c1f8777b0b6c9e91b4f7e226ed271d53ed467fa..f5061e7e2696cfc2c6d1e5c03935c7eebbf4ca0b 100755 (executable)
@@ -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