]> Savannah Git Hosting - gnulib.git/commitdiff
gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
authorBruno Haible <bruno@clisp.org>
Thu, 8 Jun 2017 12:45:39 +0000 (14:45 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 8 Jun 2017 12:45:39 +0000 (14:45 +0200)
* gnulib-tool (func_ln_s): Determine cp_src correctly.

ChangeLog
gnulib-tool

index af6de61113082e8a2706cfb856af3137791352c6..7601a1c245e707e659cb87aafdc29f0d30bf3018 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-08  Bruno Haible  <bruno@clisp.org>
+
+       gnulib-tool: Fix bug in func_ln_s, from 2016-01-15.
+       * gnulib-tool (func_ln_s): Determine cp_src correctly.
+
 2017-06-07  Bruno Haible  <bruno@clisp.org>
 
        canonicalize-lgpl: Avoid conflict with gnulib 'getcwd' module on VMS.
index a0dc0372e2fce1db09808bc18c2b514fcce3b1a1..e3364667c948e15cae475bcb11ea65f013cd1113 100755 (executable)
@@ -784,9 +784,13 @@ func_ln_s ()
 
     case "$1" in
       /* | ?:*) # SRC is absolute.
-        cp_src=$1 ;;
+        cp_src="$1" ;;
       *) # SRC is relative to the directory of DEST.
-        cp_src=${2%/*}/$1 ;;
+        case "$2" in
+          */*) cp_src="${2%/*}/$1" ;;
+          *)   cp_src="$1" ;;
+        esac
+        ;;
     esac
 
     cp -p "$cp_src" "$2"