--- regex.c.orig 2021-11-11 14:08:55.000000000 -0500
+++ regex.c 2021-11-11 15:19:47.000000000 -0500
@@ -102,9 +102,24 @@
i = isafter(i, s, rx2);
if (i < 0)
return 0;
+ // Because the for loop will increment i (the index
+ // into string s) at the end of this block, but i now
+ // already points to the next char in s, this next char
+ // gets ignored.
+ // Without this next decrement, if the regex is *bla,
+ // it will incorrectly say that blax matches, although
+ // correctly say that blaxy doesn't. Ie. char x is skipped
+ if (i>0) i--;
}
- else
- return match;
+ else {
+ // We arrived at the end of the regex BUT if it doesn't
+ // end with the wildcard * and there are more chars
+ // in s remaining to be matched, we should return 0
+ if ((i < len) && (rx[l-1] != '*'))
+ return 0;
+ else
+ return match;
+ }
}
return match;
}
On Thu, 11 Nov 2021 15:24:52 -0500, Dennis Nezic wrote:
> Here's a small patch for regex.c
>
> Currently, in matches.cfg, "Title *bla ..." will match any title with
> "bla" in it ... but it should only match if the title ends in bla,
> right?
>
> By the way, the indentations in that file are ... weird :P.
>
> _______________________________________________
> enlightenment-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/enlightenment-users
_______________________________________________
enlightenment-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-users