From a894904947777bbc797a69b1d55ca4008375acaf Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 4 Sep 2014 08:40:14 -0400 Subject: In computing command lines, put filenames inside of quotes, to support spaces and other funky characters nicely --- src/compiler.sml | 7 +++++-- 1 file 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 () => ()) -- cgit v1.2.3