diff --git a/bin/release/redis-2.8.12.zip b/bin/release/redis-2.8.12.zip index f8d484321efd6ff3e4a08283c9eb4a68da23c4d0..260515a44a07a5963b06f5582d397579dc500fcf 100644 Binary files a/bin/release/redis-2.8.12.zip and b/bin/release/redis-2.8.12.zip differ diff --git a/src/Win32_Interop/Win32_CommandLine.cpp b/src/Win32_Interop/Win32_CommandLine.cpp index ffc66ebdeb6ba75719137763e39317fffb260048..870d25c379ce02cb5bcc6f2a0379518bd662730f 100644 --- a/src/Win32_Interop/Win32_CommandLine.cpp +++ b/src/Win32_Interop/Win32_CommandLine.cpp @@ -447,21 +447,37 @@ std::vector split(const std::string &s, char delim) { vector Tokenize(string line) { vector tokens; stringstream token; - for (string::iterator sit = line.begin(); sit != line.end(); sit++) { + + // no need to parse empty lines, or comment lines (which may have unbalanced quotes) + if ((line.length() == 0) || + ((line.length() != 0) && (*line.begin()) == '#')) { + return tokens; + } + + for (string::const_iterator sit = line.begin(); sit != line.end(); sit++) { char c = *(sit); if (isspace(c) && token.str().length() > 0) { tokens.push_back(token.str()); token.str(""); } else if (c == '\'' || c == '\"') { char endQuote = c; - while (++sit != line.end()) { - if (*sit == endQuote) break; - token << *sit; + string::const_iterator endQuoteIt = sit; + while (++endQuoteIt != line.end()) { + if (*endQuoteIt == endQuote) break; + } + if (endQuoteIt != line.end()) { + while (++sit != endQuoteIt) { + token << (*sit); + } + + string path = token.str(); + replace(path.begin(), path.end(), '/', '\\'); + tokens.push_back(path); + token.str(""); + } else { + // stuff the imbalanced quote character and continue + token << (*sit); } - string path = token.str(); - replace(path.begin(), path.end(), '/', '\\'); - tokens.push_back(path); - token.str(""); } else { token << c; }