[MLton-commit] r7333

Wesley Terpstra wesley at mlton.org
Sun Nov 1 15:38:41 PST 2009


Long paths aren't always unique in their tailing 60 bytes.


----------------------------------------------------------------------

U   mlton/trunk/package/mingw/dirs2wix.sml
U   mlton/trunk/package/mingw/files2cmp.sml
U   mlton/trunk/package/mingw/files2wix.sml

----------------------------------------------------------------------

Modified: mlton/trunk/package/mingw/dirs2wix.sml
===================================================================
--- mlton/trunk/package/mingw/dirs2wix.sml	2009-11-01 23:20:35 UTC (rev 7332)
+++ mlton/trunk/package/mingw/dirs2wix.sml	2009-11-01 23:38:37 UTC (rev 7333)
@@ -8,11 +8,9 @@
    \  </Fragment>\n\
    \</Wix>\n"
 
-fun tail s =
-    if String.size s < 60 then s else
-    String.extract (s, String.size s - 60, NONE)
-fun escape c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
-val escape = tail o CharVector.map escape
+fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun escape s = Word32.toString (MLton.hash s) ^ "." ^ 
+               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
 
 val depth = ref 3
 fun pad () = CharVector.tabulate (!depth * 2, fn _ => #" ")

Modified: mlton/trunk/package/mingw/files2cmp.sml
===================================================================
--- mlton/trunk/package/mingw/files2cmp.sml	2009-11-01 23:20:35 UTC (rev 7332)
+++ mlton/trunk/package/mingw/files2cmp.sml	2009-11-01 23:38:37 UTC (rev 7333)
@@ -14,11 +14,9 @@
    \  </Fragment>\n\
    \</Wix>\n"
 
-fun tail s =
-    if String.size s < 60 then s else
-    String.extract (s, String.size s - 60, NONE)
-fun escape c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
-val escape = tail o CharVector.map escape
+fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun escape s = Word32.toString (MLton.hash s) ^ "." ^ 
+               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
 
 fun component path = 
    case OS.Path.splitDirFile path of {file, dir} =>

Modified: mlton/trunk/package/mingw/files2wix.sml
===================================================================
--- mlton/trunk/package/mingw/files2wix.sml	2009-11-01 23:20:35 UTC (rev 7332)
+++ mlton/trunk/package/mingw/files2wix.sml	2009-11-01 23:38:37 UTC (rev 7333)
@@ -6,11 +6,9 @@
    \  </Fragment>\n\
    \</Wix>\n"
 
-fun tail s =
-    if String.size s < 60 then s else
-    String.extract (s, String.size s - 60, NONE)
-fun escape c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
-val escape = tail o CharVector.map escape
+fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun escape s = Word32.toString (MLton.hash s) ^ "." ^ 
+               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
 
 fun dirEntry path =
    let




More information about the MLton-commit mailing list