Set Maintainer: FSF in some files
[bpt/emacs.git] / build-aux / msys-to-w32
old mode 100644 (file)
new mode 100755 (executable)
index 31149ea..4c92cc9
@@ -3,7 +3,7 @@
 # MS-Windows format.
 # Status is zero if successful, nonzero otherwise.
 
-# Copyright (C) 2013 Free Software Foundation, Inc.
+# Copyright (C) 2013-2014 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -36,8 +36,9 @@ transformations:
 3. Replace two consecutive slashes with single ones.
 4. Translate to Windows-native format those paths that are not in such
    format already. The translated paths will not end with a slash,
-   except for root directories (e.g. 'c:/' or 'c:/foo').
-5. Escape with backslashes every ocurrence of SEPARATOR2 within the paths.
+   except for root directories (e.g. 'c:/' or 'c:/foo').  Paths
+   starting with '%emacs_dir%' will not be translated.
+5. Escape with backslashes every occurrence of SEPARATOR2 within the paths.
 6. Concatenate the translated paths with SEPARATOR2.
 
 If MUSTEXIST is 'Y' or not supplied, then each path in PATHLIST must
@@ -100,12 +101,16 @@ do
     p="${p//\\//}"
     p="${p//\/\///}"
 
-    if test -d "$p"
+    if test "${p:0:11}" = "%emacs_dir%"
+    then
+       # Paths starting with "%emacs_dir%" will not be translated
+       w32p=$p
+    elif test -d "$p"
     then
        # The path exists, so just translate it
        w32p=`cd "$p" && pwd -W`
     else
-       # The path does not exists.  So, try to guess the
+       # The path does not exist.  So, try to guess the
        # Windows-native translation, by looking for the deepest
        # existing directory in this path, and then translating the
        # existing part and concatenating the remainder.
@@ -162,4 +167,4 @@ do
 done
 
 # Write the translated pathlist to the standard output
-printf "${w32pathlist}"
+printf "%s" "${w32pathlist}"