summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/odb.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/odb/odb.cxx b/odb/odb.cxx
index d801e1f..488e4a3 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -304,6 +304,25 @@ main (int argc, char* argv[])
if (!v.empty ())
{
o += '=';
+
+ // On Windows we need to protect values with spaces using quotes.
+ // Since there could be actual quotes in the value, we need to
+ // escape them.
+ //
+#ifdef _WIN32
+ {
+ string t ("\"");
+ for (size_t i (0); i < v.size (); ++i)
+ {
+ if (v[i] == '"')
+ t += "\\\"";
+ else
+ t += v[i];
+ }
+ t += '"';
+ v = t;
+ }
+#endif
o += v;
}