|
From: Steve H. <S.W...@ec...> - 2008-02-24 18:56:12
|
Good catch.
You might want to check out the package that this code from, if the
errors weren't thing I introduced when porting it then they might
appreciate a patch.
I don't remember what package it was, but it should say in the comments.
- Steve
On 24 Feb 2008, at 18:53, Stephen Sinclair wrote:
> 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++;
> }
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> liblo-devel mailing list
> lib...@li...
> https://lists.sourceforge.net/lists/listinfo/liblo-devel
|