data1 cleanup
[yaz-moved-to-github.git] / client / client.c
index 035862d..748c184 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (c) 1995-2002, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.147 2002-03-20 14:35:42 adam Exp $
+ * $Id: client.c,v 1.151 2002-05-03 13:48:27 adam Exp $
  */
 
 #include <stdio.h>
@@ -89,6 +89,12 @@ static QueryType queryType = QueryType_Prefix;
 static CCL_bibset bibset;               /* CCL bibset handle */
 #endif
 
+#if HAVE_READLINE_COMPLETION_OVER
+
+#else
+/* readline doesn't have this var. Define it ourselves. */
+int rl_attempted_completion_over = 0;
+#endif
 
 /* set this one to 1, to avoid decode of unknown MARCs  */
 #define AVOID_MARC_DECODE 1
@@ -2601,7 +2607,7 @@ void process_cmd_line(char* line)
     {
         printf("Unknown command: %s.\n", word);
         cmd_help ("");
-
+        res = 1;
     }
 
     if(apdu_file) fflush(apdu_file);
@@ -2639,7 +2645,7 @@ char ** readline_completer(char *text, int start, int end) {
 #if HAVE_READLINE_READLINE_H
 
     if(start == 0) {
-#ifdef RL_READLINE_VERSION
+#if HAVE_READLINE_RL_COMPLETION_MATCHES
         char** res=rl_completion_matches(text,
                                       command_generator); 
 #else
@@ -2670,7 +2676,7 @@ char ** readline_completer(char *text, int start, int end) {
         if(!cmd[i].complete_filenames) 
             rl_attempted_completion_over = 1;    
         if(cmd[i].rl_completerfunction) {
-#ifdef RL_READLINE_VERSION
+#ifdef HAVE_READLINE_RL_COMPLETION_MATCHES
             char** res=
                 rl_completion_matches(text,
                                    cmd[i].rl_completerfunction);