texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[7199] fix absolute path given to --build-dir


From: gavinsmith0123
Subject: [7199] fix absolute path given to --build-dir
Date: Mon, 30 May 2016 19:14:37 +0000 (UTC)

Revision: 7199
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7199
Author:   gavin
Date:     2016-05-30 19:14:36 +0000 (Mon, 30 May 2016)
Log Message:
-----------
fix absolute path given to --build-dir

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/util/texi2dvi

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-05-29 20:26:30 UTC (rev 7198)
+++ trunk/ChangeLog     2016-05-30 19:14:36 UTC (rev 7199)
@@ -1,3 +1,11 @@
+2016-05-30  Gavin Smith  <address@hidden>
+
+       * util/texi2dvi (cd_dir): Check if argument is absolute, and if 
+       so, make all the path variables absolute.  Fix test of whether a 
+       variable is absolute or not.  Absolute path given to --build-dir 
+       broken reported by Daniel Gerbert.
+       (cd_orig): If cdd_prefix is empty, don't try to remove it.
+
 2016-05-29  Gavin Smith  <address@hidden>
 
        * tp/t/test-utils.pl (@avoided_keys_tree): Don't compare 

Modified: trunk/util/texi2dvi
===================================================================
--- trunk/util/texi2dvi 2016-05-29 20:26:30 UTC (rev 7198)
+++ trunk/util/texi2dvi 2016-05-30 19:14:36 UTC (rev 7199)
@@ -240,12 +240,23 @@
 cd_dir ()
 {
   cd "$1"
+
+  # Check if argument is absolute, and if so, make all the path variables
+  # absolute.
+  case "$1" in
+  [\\/]* | ?:[\\/]*)  # absolute path
+    for cdd_dir in $path_vars; do
+      eval "$cdd_dir=\`absolute \$$cdd_dir\`"
+    done
+    return ;;
+  esac
+
   # Replace each path component with ".." and remove any trailing slash.
   cdd_prefix=`echo "$1" | \$SED -e 's/[^/\\][^/\\]*/../g' -e 's/[/\\]$//'`
 
   # Add this prefix for some variables.
   for cdd_dir in $path_vars; do
-    eval "case \"$$cdd_dir\" in
+    eval "case \"\$$cdd_dir\" in
           [\\/]* | ?:[\\/]*) ;;  # absolute path - do nothing
           ?*)
              eval \"\$cdd_dir=\$cdd_prefix/\\\$\$cdd_dir\" ;;
@@ -273,6 +284,8 @@
   # - the next file is processed in correct conditions
   # - the temporary file can be removed
   cd "$orig_pwd" || exit 1
+
+  test -z "$cdd_prefix" && return
   
   # strip off ../../ from some variables
   # quote string by placing \ before each character (each either . or /)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]