summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2014-09-04 08:40:14 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2014-09-04 08:40:14 -0400
commita894904947777bbc797a69b1d55ca4008375acaf (patch)
tree04853bc839d5060134b55813708584cbbe413223 /src/compiler.sml
parent4fe4c6868a10db99ddadf4cd60576178df29c8cd (diff)
In computing command lines, put filenames inside of quotes, to support spaces and other funky characters nicely
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml7
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 () => ())