small further enhancement, bug #127450
authorWilliam M. Brack <wbrack@src.gnome.org>
Fri, 21 Nov 2003 10:21:30 +0000 (10:21 +0000)
committerWilliam M. Brack <wbrack@src.gnome.org>
Fri, 21 Nov 2003 10:21:30 +0000 (10:21 +0000)
* libxslt/keys.c: small further enhancement, bug #127450

ChangeLog
libxslt/keys.c

index f8ef75e..4a95cd3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Fri Nov 21 18:17:32 HKT 2003 William Brack <wbrack@mmm.com.hk>
+
+       * libxslt/keys.c: small further enhancement, bug #127450
+
 Thu Nov 20 17:26:57 CET 2003 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/keys.c: another problem reported by Oleg Paraschenko
index 27452a3..008b379 100644 (file)
@@ -260,10 +260,12 @@ skipPredicate(const xmlChar *cur, int end) {
            end = skipString(cur, end);
            if (end <= 0)
                return(-1);
+           continue;
        } else if (cur[end] == '[') {
            end = skipPredicate(cur, end);
            if (end <= 0)
                return(-1);
+           continue;
        } else if (cur[end] == ']')
            return(end + 1);
        end++;
@@ -317,10 +319,13 @@ xsltAddKey(xsltStylesheetPtr style, const xmlChar *name,
        while ((match[end] != 0) && (match[end] != '|')) {
            if (match[end] == '[') {
                end = skipPredicate(match, end);
-               if (end <= 0)
+               if (end <= 0) {
                    xsltTransformError(NULL, style, inst,
                                       "key pattern is malformed: %s",
                                       key->match);
+                   if (style != NULL) style->errors++;
+                   goto error;
+               }
            } else
                end++;
        }