From: Adam Chlipala Date: Sat, 8 Dec 2007 02:41:07 +0000 (+0000) Subject: errorDocument outputs quotes as needed X-Git-Tag: release_2010-11-19~100 X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/commitdiff_plain/989965b1b38fc4932b5c9286b8098d9bbf138995 errorDocument outputs quotes as needed --- diff --git a/src/plugins/apache.sml b/src/plugins/apache.sml index 7cdc613..c4b684f 100644 --- a/src/plugins/apache.sml +++ b/src/plugins/apache.sml @@ -653,12 +653,24 @@ val () = Env.action_two "scriptAlias" val () = Env.action_two "errorDocument" ("code", Env.string, "handler", Env.string) (fn (code, handler) => - (write "\tErrorDocument\t"; - write code; - write " "; - write handler; - write "\n")) + let + val hasSpaces = CharVector.exists Char.isSpace handler + fun maybeQuote () = + if hasSpaces then + write "\"" + else + () + in + write "\tErrorDocument\t"; + write code; + write " "; + maybeQuote (); + write handler; + maybeQuote (); + write "\n" + end) + val () = Env.action_one "options" ("options", Env.list apache_option) (fn opts =>