On Sat, 13 Nov 2021 18:11:02 +0100, Kim Woelders wrote:
> On 11/13/21 16:17, Dennis Nezic wrote:
> > On Sat, 13 Nov 2021 07:33:19 +0100, Kim Woelders wrote:
> >> On 11/13/21 05:18, Dennis Nezic wrote:
> >>> On Fri, 12 Nov 2021 17:48:50 +0100, Kim Woelders wrote:
> >>>> On 11/11/21 21:24, 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?
> >>>>>
> >>>> Right.
> >>>>
> >>>> Patch looks good to me - pushed to git.
> >>>
> >>> (Tiny improvement ... we don't need the "if (i>0)" test in that
> >>> patch ... isafter() will never return 0 ... a simple decrement is
> >>> fine.)
> >>>
> >> Hmm.. then I think we can just drop the decrement if we drop the
> >> increment in the for loop too, right?
> > 
> > Oh yea, I forgot for loops could do that :)
> > 
> Update pushed.

The last "return match" occurs when we've reached the end of the string
that's being checked. But if there are more characters in the regex to
test for, we need to return 0.

--- a/src/regex.c       2021-11-15 00:18:59.000000000 -0500
+++ b/src/regex.c       2021-11-15 00:20:55.000000000 -0500
@@ -114,5 +114,8 @@
                return match;
          }
      }
+   while (rx[l])
+      if (rx[l++] != '*')
+         return 0;
    return match;
 }


_______________________________________________
enlightenment-users mailing list
enlightenment-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-users

Reply via email to