projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Move var_set and variable parsing declarations into new header.
[pspp-builds.git]
/
src
/
ui
/
terminal
/
read-line.c
diff --git
a/src/ui/terminal/read-line.c
b/src/ui/terminal/read-line.c
index 7122b78d8777a11cafe644f4e55a25ebf046ea16..a87adfcf7ef8eacda1ce785abb6ccdf6ed57bb1e 100644
(file)
--- a/
src/ui/terminal/read-line.c
+++ b/
src/ui/terminal/read-line.c
@@
-19,20
+19,23
@@
#include <config.h>
#include <config.h>
+#include "read-line.h"
+
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
#include <errno.h>
-#include "read-line.h"
+#include "msg-ui.h"
+
+#include <data/file-name.h>
+#include <data/file-name.h>
+#include <data/settings.h>
#include <language/command.h>
#include <language/command.h>
-#include <data/filename.h>
-#include <libpspp/version.h>
+#include <libpspp/message.h>
#include <libpspp/str.h>
#include <libpspp/str.h>
+#include <libpspp/version.h>
#include <output/table.h>
#include <output/table.h>
-#include <libpspp/message.h>
-#include <data/filename.h>
-#include <data/settings.h>
#include "gettext.h"
#define _(msgid) gettext (msgid)
#include "gettext.h"
#define _(msgid) gettext (msgid)
@@
-53,8
+56,9
@@
readln_initialize (void)
{
initialised = true;
{
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)
{
#ifdef unix
if (history_file == NULL)
{
@@
-117,8
+121,7
@@
readln_read (struct string *line, const char *prompt)
assert(initialised);
assert(initialised);
- err_error_count = err_warning_count = 0;
- err_already_flagged = 0;
+ reset_msg_count ();
welcome ();
welcome ();
@@
-130,14
+133,14
@@
readln_read (struct string *line, const char *prompt)
{
if (string[0])
add_history (string);
{
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);
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;
{
ds_chomp (line, '\n');
return true;