diff options
author | Adam Chlipala <adam@chlipala.net> | 2014-09-04 08:40:14 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2014-09-04 08:40:14 -0400 |
commit | a894904947777bbc797a69b1d55ca4008375acaf (patch) | |
tree | 04853bc839d5060134b55813708584cbbe413223 | |
parent | 4fe4c6868a10db99ddadf4cd60576178df29c8cd (diff) |
In computing command lines, put filenames inside of quotes, to support spaces and other funky characters nicely
-rw-r--r-- | src/compiler.sml | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/compiler.sml b/src/compiler.sml index 716cc3d3..b46643ff 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -1,4 +1,4 @@ -(* Copyright (c) 2008-2012, Adam Chlipala +(* Copyright (c) 2008-2012, 2014, Adam Chlipala * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -1483,7 +1483,10 @@ val sqlify = { val toSqlify = transform sqlify "sqlify" o toMono_opt2 -val escapeFilename = String.translate (fn #" " => "\\ " | #"\"" => "\\\"" | #"'" => "\\'" | ch => str ch) +fun escapeFilename s = + "\"" + ^ String.translate (fn #"\"" => "\\\"" | #"\\" => "\\\\" | ch => str ch) s + ^ "\"" val beforeC = ref (fn () => ()) |