projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add missing _() around messages.
[pspp]
/
src
/
ui
/
terminal
/
read-line.c
diff --git
a/src/ui/terminal/read-line.c
b/src/ui/terminal/read-line.c
index 97427c6c1a59754a1f5ce20cfa31596566b8cb5c..f28fb6fe3912a989a1df8ef74d234ffc402474c4 100644
(file)
--- a/
src/ui/terminal/read-line.c
+++ b/
src/ui/terminal/read-line.c
@@
-1,6
+1,5
@@
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
/* PSPP - computes sample statistics.
Copyright (C) 1997-9, 2000 Free Software Foundation, Inc.
- Written by Ben Pfaff <blp@gnu.org>.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-71,16
+70,18
@@
readln_initialize (void)
#if HAVE_READLINE
rl_basic_word_break_characters = "\n";
#if HAVE_READLINE
rl_basic_word_break_characters = "\n";
-#ifdef unix
+ using_history ();
+ stifle_history (500);
if (history_file == NULL)
{
if (history_file == NULL)
{
- history_file = tilde_expand ("~/.pspp_history");
- using_history ();
- read_history (history_file);
- stifle_history (500);
+ const char *home_dir = getenv ("HOME");
+ if (home_dir != NULL)
+ {
+ history_file = xasprintf ("%s/.pspp_history", home_dir);
+ read_history (history_file);
+ }
}
#endif
}
#endif
-#endif
}
/* Close getl. */
}
/* Close getl. */
@@
-89,7
+90,7
@@
readln_uninitialize (void)
{
initialised = false;
{
initialised = false;
-#if HAVE_READLINE
&& unix
+#if HAVE_READLINE
if (history_file != NULL && false == get_testing_mode() )
write_history (history_file);
clear_history ();
if (history_file != NULL && false == get_testing_mode() )
write_history (history_file);
clear_history ();
@@
-99,11
+100,13
@@
readln_uninitialize (void)
static bool
static bool
-read_interactive (struct getl_interface *s, struct string *line)
+read_interactive (struct getl_interface *s,
+ struct string *line, enum getl_syntax *syntax)
{
struct readln_source *is =
(struct readln_source *) s ;
{
struct readln_source *is =
(struct readln_source *) s ;
+ *syntax = GETL_INTERACTIVE;
return is->interactive_func (line, prompt_get_style ());
}
return is->interactive_func (line, prompt_get_style ());
}
@@
-126,23
+129,9
@@
welcome (void)
"conditions.\nThere is ABSOLUTELY NO WARRANTY for PSPP; type \"show "
"warranty.\" for details.\n", stdout);
puts (stat_version);
"conditions.\nThere is ABSOLUTELY NO WARRANTY for PSPP; type \"show "
"warranty.\" for details.\n", stdout);
puts (stat_version);
-
-#if HAVE_READLINE && unix
- if (history_file == NULL)
- {
- history_file = tilde_expand ("~/.pspp_history");
- using_history ();
- read_history (history_file);
- stifle_history (500);
- }
-#endif
+ readln_initialize ();
}
}
-
-
-
-
-
/* Gets a line from the user and stores it into LINE.
Prompts the user with PROMPT.
Returns true if successful, false at end of file.
/* Gets a line from the user and stores it into LINE.
Prompts the user with PROMPT.
Returns true if successful, false at end of file.