Put local variables footer in all c, h files.
[idzebra-moved-to-github.git] / recctrl / recgrs.c
index 274c130..55bdaa5 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: recgrs.c,v 1.106 2006-02-06 13:34:13 adam Exp $
+/* $Id: recgrs.c,v 1.109 2006-05-10 08:13:28 adam Exp $
    Copyright (C) 1995-2005
    Index Data ApS
 
@@ -350,6 +350,7 @@ static int dfa_match_first(struct DFA_state **dfaar, const char *text)
     unsigned char c;
     
     for (c = *p++, t = s->trans, i = s->tran_no; --i >= 0; t++)
+    {
        if (c >= t->ch[0] && c <= t->ch[1])
        {
            while (i >= 0)
@@ -359,12 +360,15 @@ static int dfa_match_first(struct DFA_state **dfaar, const char *text)
                if (s->rule_no)
                    return 1;
                /* next char */
+               if (!c)
+                   return 0;
                c = *p++;
                for (t = s->trans, i = s->tran_no; --i >= 0; t++)
                    if (c >= t->ch[0] && c <= t->ch[1])
                        break;
            }
        }
+    }
     return 0;
 }
 
@@ -813,9 +817,8 @@ static void index_xpath(struct source_parser *sp, data1_node *n,
                                                   p, wrd);
                                 xpdone = 1;
                             } else {
-                                /* if this fragment is enabled, we index
-                                  attribute values as well. See bug #460 */
-                                if (0 && xp->value) 
+                                /* index attribute value (only path/@attr) */
+                                if (xp->value) 
                                {
 #if NATTR
                                    wrd->index_name = tl->index_name;
@@ -1550,3 +1553,11 @@ int zebra_grs_retrieve(void *clientData, struct recRetrieveCtrl *p,
     return 0;
 }
 
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+