aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-08-16 19:25:36 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-08-16 19:25:36 -0700
commitd0c85471b40fee548efc35a370f5d5c4b656f66a (patch)
tree062046d81b896bda0eca54e5ac5de8dd409369f3 /common.cpp
parent06400b83b188156f31ed92216ec27122d29f88cd (diff)
Make escape_string transform wildcard characters
The characters ANY_CHAR, ANY_STRING, and ANY_STRING_RECURSIVE are currently transformed by unescape, but not by escape. Let's try escaping them. Fixes #1614.
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/common.cpp b/common.cpp
index 001eab0f..b8a2661d 100644
--- a/common.cpp
+++ b/common.cpp
@@ -1019,7 +1019,22 @@ static void escape_string_internal(const wchar_t *orig_in, size_t in_len, wcstri
out += *in;
break;
}
+
+
+ // Experimental fix for #1614
+ // The hope is that any time these appear in a string, they came from wildcard expansion
+ case ANY_CHAR:
+ out += L'?';
+ break;
+ case ANY_STRING:
+ out += L'*';
+ break;
+
+ case ANY_STRING_RECURSIVE:
+ out += L"**";
+ break;
+
case L'&':
case L'$':
case L' ':