RPA Toolkit
Fixed rpa_stat_scan error handling
authorMartin Stoilov <martin@rpasearch.com>
Wed, 20 Jul 2011 05:25:38 +0000 (22:25 -0700)
committerMartin Stoilov <martin@rpasearch.com>
Wed, 20 Jul 2011 05:25:38 +0000 (22:25 -0700)
rgrep/rpagrep.c
rpa/rpastat.c

index 51582b4..1bc5030 100644 (file)
@@ -316,7 +316,7 @@ again:
                rpa_grep_output(pGrep, matched, ret, pGrep->encoding);
                rpa_grep_output_utf8_string(pGrep, "\n");
        }
-       if (ret && matched + ret < end) {
+       if (ret > 0 && matched + ret < end) {
                input = matched + ret;
                goto again;
        }
index 9d5e49f..ac684dd 100644 (file)
@@ -181,8 +181,11 @@ long rpa_stat_scan(rpastat_t *stat, rparule_t rid, unsigned int encoding, const
 
        while (input < end) {
                ret = rpa_stat_exec_rid(stat, rid, encoding, input, start, end, NULL);
-               if (ret < 0)
-                       return -1;
+               if (ret < 0) {
+                       if (rpa_stat_lasterror(stat) != RPA_E_RULEABORT) {
+                               return -1;
+                       }
+               }
                if (ret > 0) {
                        *where = input;
                        return ret;