From b8cec4a2571596692c1e0b27cc3953ecff712178 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 Jun 2010 09:25:29 +0200 Subject: Add support for single quotes in option files --- cli/runtime-source.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli/runtime-source.cxx') 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);" -- cgit v1.1