Fix Savannah bug #30312.
authorEli Zaretskii <eliz@gnu.org>
Fri, 9 Jul 2010 11:40:19 +0000 (11:40 +0000)
committerEli Zaretskii <eliz@gnu.org>
Fri, 9 Jul 2010 11:40:19 +0000 (11:40 +0000)
 function.c (abspath): Support absolute file names in UNC format.

ChangeLog
function.c

index 97cf81d99a19cd767b7d4e332b9a91822b086008..79ee21600cecaf90f760e19c3131768a4699d776 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2010-07-09  Eli Zaretskii  <eliz@gnu.org>
 
+       * function.c (abspath): Support absolute file names in UNC format.
+       (Savannah bug #30312.)
+
        * job.c (pid2str) [WINDOWS32]: Don't use %Id with GCC < 4.x.
        (exec_command) [WINDOWS32]: Use pid2str instead of non-portable
        %Id.
index 45ebc9ef831804f82e58723a4c3a22a75431221d..870e4a059f98669d0243fb6d7c86654ebfa36bf7 100644 (file)
@@ -1912,6 +1912,13 @@ abspath (const char *name, char *apath)
 #ifdef HAVE_DOS_PATHS
       if (IS_PATHSEP(name[0]))
        {
+         if (IS_PATHSEP(name[1]))
+           {
+             /* A UNC.  Don't prepend a drive letter.  */
+             apath[0] = name[0];
+             apath[1] = name[1];
+             root_len = 2;
+           }
          /* We have /foo, an absolute file name except for the drive
             letter.  Assume the missing drive letter is the current
             drive, which we can get if we remove from starting_directory