[MLton-commit] r7337

Wesley Terpstra wesley at mlton.org
Sun Nov 1 16:14:50 PST 2009


Some filenames are too long all by themselves.


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

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-02 00:12:46 UTC (rev 7336)
+++ mlton/trunk/package/mingw/dirs2wix.sml	2009-11-02 00:14:50 UTC (rev 7337)
@@ -10,8 +10,9 @@
 
 fun hash (c, w) = w * 0w5746711073709751657 + Word64.fromInt (Char.ord c)
 fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun trim s = if String.size s > 40 then String.sub (s, 0, 40) else s
 fun escape s = Word64.toString (foldl hash 0w0 (explode s)) ^ "." ^ 
-               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
+               trim (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-02 00:12:46 UTC (rev 7336)
+++ mlton/trunk/package/mingw/files2cmp.sml	2009-11-02 00:14:50 UTC (rev 7337)
@@ -16,8 +16,9 @@
 
 fun hash (c, w) = w * 0w5746711073709751657 + Word64.fromInt (Char.ord c)
 fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun trim s = if String.size s > 40 then String.sub (s, 0, 40) else s
 fun escape s = Word64.toString (foldl hash 0w0 (explode s)) ^ "." ^ 
-               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
+               trim (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-02 00:12:46 UTC (rev 7336)
+++ mlton/trunk/package/mingw/files2wix.sml	2009-11-02 00:14:50 UTC (rev 7337)
@@ -8,8 +8,9 @@
 
 fun hash (c, w) = w * 0w5746711073709751657 + Word64.fromInt (Char.ord c)
 fun alnum c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+fun trim s = if String.size s > 40 then String.sub (s, 0, 40) else s
 fun escape s = Word64.toString (foldl hash 0w0 (explode s)) ^ "." ^ 
-               (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
+               trim (CharVector.map alnum (#file (OS.Path.splitDirFile s)))
 
 fun dirEntry path =
    let




More information about the MLton-commit mailing list