projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Did some more work on bug 12859 and then realized that a *good*
[pspp]
/
src
/
getline.c
diff --git
a/src/getline.c
b/src/getline.c
index 21fdc5243d372649c0a19183bb31dae378cb3efa..3c58edcc31610606e741a313a9e72eb69569f2c9 100644
(file)
--- a/
src/getline.c
+++ b/
src/getline.c
@@
-14,8
+14,8
@@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 5
9 Temple Place - Suite 330
, Boston, MA
- 0211
1-1307
, USA. */
+ Foundation, Inc., 5
1 Franklin Street, Fifth Floor
, Boston, MA
+ 0211
0-1301
, USA. */
#include <config.h>
#include "getline.h"
#include <config.h>
#include "getline.h"
@@
-24,6
+24,7
@@
#include <errno.h>
#include <stdlib.h>
#include "alloc.h"
#include <errno.h>
#include <stdlib.h>
#include "alloc.h"
+#include "command.h"
#include "error.h"
#include "filename.h"
#include "lexer.h"
#include "error.h"
#include "filename.h"
#include "lexer.h"
@@
-43,6
+44,10
@@
int getl_welcomed;
int getl_mode;
int getl_prompt;
int getl_mode;
int getl_prompt;
+#if HAVE_LIBREADLINE
+#include <readline/readline.h>
+#endif
+
#if HAVE_LIBHISTORY
static char *history_file;
#if HAVE_LIBHISTORY
static char *history_file;
@@
-57,6
+62,7
@@
extern int write_history (char *);
#endif /* no readline/history.h */
#endif /* -lhistory */
#endif /* no readline/history.h */
#endif /* -lhistory */
+
extern struct cmd_set cmd;
static struct string getl_include_path;
extern struct cmd_set cmd;
static struct string getl_include_path;
@@
-75,12
+81,16
@@
getl_initialize (void)
ds_create (&getl_include_path,
fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
ds_init (&getl_buf, 256);
ds_create (&getl_include_path,
fn_getenv_default ("STAT_INCLUDE_PATH", include_path));
ds_init (&getl_buf, 256);
+#if HAVE_LIBREADLINE
+ rl_completion_entry_function = pspp_completion_function;
+#endif
}
/* Close getline. */
void
getl_uninitialize (void)
{
}
/* Close getline. */
void
getl_uninitialize (void)
{
+ getl_close_all();
#if HAVE_LIBHISTORY && defined (unix)
if (history_file)
write_history (history_file);
#if HAVE_LIBHISTORY && defined (unix)
if (history_file)
write_history (history_file);