summaryrefslogtreecommitdiff
path: root/cli/runtime-source.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2010-06-04 09:25:29 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2010-06-04 09:25:29 +0200
commitb8cec4a2571596692c1e0b27cc3953ecff712178 (patch)
tree2aadf52a5f0dea3af5d45c894f0370274e6042b2 /cli/runtime-source.cxx
parent840f2fae3995a3e263801ad07d1285d35ddd9485 (diff)
Add support for single quotes in option files
Diffstat (limited to 'cli/runtime-source.cxx')
-rw-r--r--cli/runtime-source.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/runtime-source.cxx b/cli/runtime-source.cxx
index 348d7b7..e2008ad 100644
--- a/cli/runtime-source.cxx
+++ b/cli/runtime-source.cxx
@@ -392,10 +392,11 @@ generate_runtime_source (context& ctx)
<< "// If the string is wrapped in quotes, remove them." << endl
<< "//" << endl
<< "n = s2.size ();"
+ << "char cf (s2[0]), cl (s2[n - 1]);"
<< endl
- << "if (s2[0] == '\"' || s2[n - 1] == '\"')"
+ << "if (cf == '\"' || cf == '\\'' || cl == '\"' || cl == '\\'')"
<< "{"
- << "if (n == 1 || s2[0] != s2[n - 1])" << endl
+ << "if (n == 1 || cf != cl)" << endl
<< "throw unmatched_quote (s2);"
<< endl
<< "s2 = string (s2, 1, n - 2);"