Check for database in ztest_scan
[yaz-moved-to-github.git] / ztest / ztest.c
index 1396c4e..e750212 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2004, Index Data.
  * See the file LICENSE for details.
  *
- * $Id: ztest.c,v 1.67 2004-11-18 15:18:14 heikki Exp $
+ * $Id: ztest.c,v 1.69 2005-01-11 10:44:07 adam Exp $
  */
 
 /*
@@ -536,6 +536,13 @@ int ztest_scan(void *handle, bend_scan_rr *q)
     int term_position_req = q->term_position;
     int num_entries_req = q->num_entries;
 
+    if (yaz_matchstr (q->basenames[0], "Default"))
+    {
+        q->errcode = 109;
+        q->errstring = q->basenames[0];
+        return 0;
+    }
+
     q->errcode = 0;
     q->errstring = 0;
     q->entries = list;
@@ -568,7 +575,7 @@ int ztest_scan(void *handle, bend_scan_rr *q)
     memcpy(term, q->term->term->u.general->buf, q->term->term->u.general->len);
     term[q->term->term->u.general->len] = '\0';
     for (p = term; *p; p++)
-       if (islower(*p))
+       if (islower(*(unsigned char *) p))
            *p = toupper(*p);
 
     fseek(f, 0, SEEK_SET);