From 76127433b7e959ae78124b214faa20f5f573c2b0 Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sun, 8 Jan 2012 22:05:26 +0100 Subject: [PATCH] Rationale for not quoting single '"' chars --- ports/src/noux/main.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ports/src/noux/main.cc b/ports/src/noux/main.cc index 8c304a950..ec56abb18 100644 --- a/ports/src/noux/main.cc +++ b/ports/src/noux/main.cc @@ -339,15 +339,21 @@ static Noux::Args const &args_of_init_process() static void quote(char *buf, Genode::size_t buf_len) { - char c = '"'; - /* * Make sure to leave space at the end of buffer for the finishing '"' and * the null-termination. */ + char c = '"'; unsigned i = 0; for (; c && (i + 2 < buf_len); i++) { + /* + * So shouldn't this have a special case for '"' characters inside the + * string? This is actually not needed because such a string could + * never be constructed via the XML config anyway. You can sneak in '"' + * characters only by quoting them in the XML file. Then, however, they + * are already quoted. + */ char next_c = buf[i]; buf[i] = c; c = next_c;