Fix sample PQF
[yaz-moved-to-github.git] / ccl / ccltoken.c
index afbac9c..31a18d8 100644 (file)
@@ -44,7 +44,7 @@
 /* CCL - lexical analysis
  * Europagate, 1995
  *
- * $Id: ccltoken.c,v 1.19 2002-06-06 12:54:24 adam Exp $
+ * $Id: ccltoken.c,v 1.22 2003-02-14 18:49:23 adam Exp $
  *
  * Old Europagate Log:
  *
@@ -85,6 +85,7 @@
 
 #include <string.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #include <yaz/ccl.h>
 
@@ -244,7 +245,7 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command)
        case '%':
        case '!':
            last->kind = CCL_TOK_PROX;
-           while (*cp == '%' || *cp == '!')
+            while (isdigit(*cp))
            {
                ++ last->len;
                cp++;
@@ -277,9 +278,9 @@ struct ccl_token *ccl_parser_tokenize (CCL_parser cclp, const char *command)
                cp++;
            break;
        default:
-           if (!strchr ("(),%!><=- \t\n\r", cp[-1]))
+           if (!strchr ("(),%!><= \t\n\r", cp[-1]))
            {
-               while (*cp && !strchr ("(),%!><=- \t\n\r", *cp))
+               while (*cp && !strchr ("(),%!><= \t\n\r", *cp))
                {
                    cp++;
                    ++ last->len;