[m-rev.] diff: fix handling of current drive relative paths

Julien Fischer jfischer at opturion.com
Wed Sep 13 13:40:24 AEST 2023


Fix handling of current drive relative paths.

library/dir.m:
     Check the directory component, not the file name, when determining if we
      are dealing with a current drive relative path on Windows.

Julien.

diff --git a/library/dir.m b/library/dir.m
index bbe465e..c1c128f 100644
--- a/library/dir.m
+++ b/library/dir.m
@@ -935,8 +935,8 @@ DirName0/FileName0 = PathName :-
      else if
          (
              % Check for construction of relative paths of the form "C:foo".
-            path_name_names_drive_letter(FileName, ThirdCharIndex),
-            not string.index_next(FileName, ThirdCharIndex, _, _)
+            path_name_names_drive_letter(DirName, ThirdCharIndex),
+            not string.index_next(DirName, ThirdCharIndex, _, _)
          ;
              % Do not introduce duplicate directory separators.
              % On Windows, \\foo (a UNC server specification) is not equivalent


More information about the reviews mailing list