From 47a61b3acacdd5730e92bf49c72ff8ba20280808 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Tue, 18 Apr 2000 16:08:46 +0000 Subject: [PATCH] r252: Fixed a slight bug in the Find code; expressions couldn't be parsed due to the new i18n code. --- ROX-Filer/src/find.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/ROX-Filer/src/find.c b/ROX-Filer/src/find.c index 9e9052b0..12606a58 100644 --- a/ROX-Filer/src/find.c +++ b/ROX-Filer/src/find.c @@ -51,6 +51,8 @@ static FindCondition *parse_is(guchar **expression); static Eval *parse_eval(guchar **expression); static Eval *parse_variable(guchar **expression); +static gboolean match(guchar **expression, guchar *word); + typedef enum { IS_DIR, IS_REG, @@ -108,13 +110,10 @@ struct _Eval gpointer data2; }; - #define EAT ((*expression)++) #define NEXT (**expression) #define SKIP while (NEXT == ' ' || NEXT == '\t') EAT -#define MATCH(word) (g_strncasecmp(*expression, word, sizeof(word) - 1) == 0 \ - && (isalpha((*expression)[sizeof(word) - 1]) == 0) \ - && ((*expression) += sizeof(word) - 1)) +#define MATCH(word) (match(expression, word)) #ifndef S_ISVTX # define S_ISVTX 0x0001000 @@ -903,3 +902,19 @@ static Eval *parse_variable(guchar **expression) return eval; } + +static gboolean match(guchar **expression, guchar *word) +{ + int len; + + len = strlen(word); + if (g_strncasecmp(*expression, word, len)) + return FALSE; + + if (isalpha(*(*expression + len))) + return FALSE; + + (*expression) += len; + + return TRUE; +} -- 2.11.4.GIT