Merge pull request #6923

cc034fe0c util: fix escaping more than one ?* in glob_to_regex (moneromooo-monero)
This commit is contained in:
Alexander Blair 2020-12-01 14:19:21 -08:00
commit 003a06f030
No known key found for this signature in database
GPG Key ID: C64552D877C32479

View File

@ -1000,13 +1000,13 @@ std::string get_nix_version_display_string()
for (char c: val) for (char c: val)
{ {
if (c == '*') if (c == '*')
newval += escape ? "*" : ".*"; newval += escape ? "*" : ".*", escape = false;
else if (c == '?') else if (c == '?')
newval += escape ? "?" : "."; newval += escape ? "?" : ".", escape = false;
else if (c == '\\') else if (c == '\\')
newval += '\\', escape = !escape; newval += '\\', escape = !escape;
else else
newval += c; newval += c, escape = false;
} }
return newval; return newval;
} }