diff --git a/modules/libcom/src/iocsh/iocsh.cpp b/modules/libcom/src/iocsh/iocsh.cpp index 5e8b39a..669d9dc 100644 --- a/modules/libcom/src/iocsh/iocsh.cpp +++ b/modules/libcom/src/iocsh/iocsh.cpp @@ -262,16 +262,16 @@ struct Tokenize { int icout = 0; bool inword = false; bool backslash = false; - char quote = EOF; + char quote = 0; for (;;) { char c = line[icin++]; if (c == '\0') break; - bool sep = (quote == EOF) && !backslash && (strchr (" \t(),\r", c)); + bool sep = !quote && !backslash && (strchr (" \t(),\r", c)); - if ((quote == EOF) && !backslash) { + if (!quote && !backslash) { int redirectFd = 1; if (c == '\\') { backslash = true; @@ -306,10 +306,10 @@ struct Tokenize { } if (inword) { if (c == quote) { - quote = EOF; + quote = 0; } else { - if ((quote == EOF) && !backslash) { + if (!quote && !backslash) { if (sep) { inword = false; // this "closes" a sub-string which was previously @@ -343,7 +343,7 @@ struct Tokenize { else { argv.push_back(line + icout); } - if (quote == EOF) + if (!quote) line[icout++] = c; inword = true; } @@ -360,7 +360,7 @@ struct Tokenize { showError(filename, lineno, "Illegal redirection."); return true; } - if (quote != EOF) { + if (quote) { if(noise) showError(filename, lineno, "Unbalanced quote."); return true;