[MLton] Re: [MLton-commit] r6699

Matthew Fluet fluet at tti-c.org
Sun Jun 14 13:41:45 PDT 2009


On Mon, 11 Aug 2008, Wesley Terpstra wrote:
> As reported by Nicolas Bertolotti, the escape function for shell arguments was
> broken on MinGW. This patch corrects it. It might still be broken on cygwin.

It appears to be broken on cygwin.

> +      (* In cygwin, according to what I read, \ should always become \\.
> +       * Furthermore, more characters cause escaping as compared to MinGW.
> +       * From what I read, " should become "", not \", but I leave the old
> +       * behaviour alone until someone runs the spawn regression.
> +       *)
> +      fun cygwinEscape y =
> +         if not (strContains " \t\"\r\n\f'" y) andalso y<>"" then y else
> +         concat ["\"",
>                  String.translate
>                  (fn #"\"" => "\\\"" | #"\\" => "\\\\" | x => String.str x) y,
> -                 dquote]
> +                 "\""]

testing spawn
0a1,15
> FAIL: "hello\":"\"hello\\\""
> FAIL: :""
> FAIL: hi":"hi\""
> FAIL: evil
> arg:"evil
> arg"
> FAIL: evil    arg:"evil       arg"
> FAIL: evil arg:"evil arg"
> FAIL: evil^Marg:"evil^Marg"
> FAIL: evil^Larg:"evil^Larg"
> FAIL: "bar\:"\"bar\\"
> FAIL: bah \bar:"bah \\bar"
> FAIL: ba h\\:"ba h\\\\"
> FAIL: holy"smoke:"holy\"smoke"
> FAIL: holy "smoke:"holy \"smoke"
difference with -type-check true





More information about the MLton mailing list