diff options
-rw-r--r-- | tools/rrdui-cgi.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/tools/rrdui-cgi.c b/tools/rrdui-cgi.c index b593bf5..4b6b09c 100644 --- a/tools/rrdui-cgi.c +++ b/tools/rrdui-cgi.c @@ -130,9 +130,9 @@ parse_argv(const char* s, const char*** argvp) argv[argc] = buf; for (src = s; r == 0 && *src; src++) { - if (quote != '\0') { - if (quote == *src) - quote = '\0'; + if (quote == *src) { + quote = '\0'; + } else if (quote != '\0') { if (*src == '\\') { *buf++ = *src++; if (!*src) { @@ -159,16 +159,16 @@ parse_argv(const char* s, const char*** argvp) } } else { switch (*src) { + case '"': + case '\'': + quote = *src; + break; case '\\': *buf++ = *src++; if (!*src) { r = -1; errno = EINVAL; continue; } - case '"': - case '\'': - quote = *src; - /* Fall through */ default: *buf++ = *src; break; @@ -508,13 +508,13 @@ run_rrd(int argc, const char** argv) optind = 0; opterr = 0; -//#ifdef TEST +#ifdef TEST { int i; for(i = 0; i < argc; i++) fprintf(stderr, "%s\n", argv[i]); } -//#endif +#endif return rrd_graph(argc, (char**)argv, &text, &x, &y, stdout, &min, &max); } |