|
From: Stephen S. <rad...@gm...> - 2008-02-24 18:53:50
|
On Sun, Feb 24, 2008 at 1:49 PM, Stephen Sinclair <rad...@gm...> wrote:
> So the /* problem should probably be addressed.
>
And apparently it wasn't too difficult.
Here's a revised patch:
Index: pattern_match.c
===================================================================
--- pattern_match.c (revision 100)
+++ pattern_match.c (working copy)
@@ -97,7 +97,7 @@
switch (c = *p++) {
case '*':
- while (*p == '*')
+ while (*p == '*' && *p != '/')
p++;
if (!*p)
@@ -191,7 +191,7 @@
c = *p++;
- while (*p) {
+ while (c) {
if (c == ',') {
if(lo_pattern_match(str, remainder)) {
return true;
@@ -206,20 +206,22 @@
}
else if (c == '}') {
// continue normal pattern matching
- if(!*p++)
- return false;
+ if (!*p && !*str) return true;
+ str--; // str is incremented again below
break;
} else if (c == *str) {
str++;
if (!*str && *remainder)
return false;
- // p++;
} else { // skip to next comma
str = place;
while (*p != ',' && *p != '}' && *p)
p++;
if (*p == ',')
p++;
+ else if (*p == '}') {
+ return false;
+ }
}
c = *p++;
}
|