Fix // in filenames, bug1610.

This commit is contained in:
Wilson Snyder
2019-11-20 21:23:03 -05:00
parent a86e1953eb
commit 99455a16bf
3 changed files with 8 additions and 3 deletions
+4 -2
View File
@@ -1247,13 +1247,15 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename, bool rel) {
// Strip simple comments
string oline;
// cppcheck-suppress StlMissingComparison
for (string::const_iterator pos = line.begin(); pos != line.end(); ++pos) {
char lastch = ' ';
for (string::const_iterator pos = line.begin(); pos != line.end(); lastch = *pos++) {
if (inCmt) {
if (*pos=='*' && *(pos+1)=='/') {
inCmt = false;
++pos;
}
} else if (*pos=='/' && *(pos+1)=='/') {
} else if (*pos=='/' && *(pos+1)=='/'
&& (pos == line.begin() || isspace(lastch))) { // But allow /file//path
break; // Ignore to EOL
} else if (*pos=='/' && *(pos+1)=='*') {
inCmt = true;