summaryrefslogtreecommitdiff
path: root/src
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
commit113ccb92649c91d2e430f0c05bf89e8d50936825 (patch)
tree04853bc839d5060134b55813708584cbbe413223 /src
parentdd7113ccaa7b94cecfe277dcd6ecd7c1a57d4d40 (diff)
In computing command lines, put filenames inside of quotes, to support spaces and other funky characters nicely
Diffstat (limited to 'src')
-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 () => ())