Reform string library.
[pspp-builds.git] / src / ui / terminal / read-line.c
index 2a0bfd5e2be55ca584ef6c6c2f1088a5a90d22c7..a87adfcf7ef8eacda1ce785abb6ccdf6ed57bb1e 100644 (file)
@@ -56,8 +56,9 @@ readln_initialize (void)
 {
   initialised = true;
 
-#if HAVE_READLINE 
-  rl_completion_entry_function = pspp_completion_function;
+#if HAVE_READLINE
+  rl_basic_word_break_characters = "\n";
+  rl_attempted_completion_function = pspp_attempted_completion_function;
 #ifdef unix
   if (history_file == NULL)
     {
@@ -132,14 +133,14 @@ readln_read (struct string *line, const char *prompt)
     {
       if (string[0])
         add_history (string);
-      ds_assign_c_str (line, string);
+      ds_assign_cstr (line, string);
       free (string);
       return true; 
     }
 #else
   fputs (prompt, stdout);
   fflush (stdout);
-  if (ds_gets (line, stdin)) 
+  if (ds_read_line (line, stdin)) 
     {
       ds_chomp (line, '\n');
       return true;