Fix typo.
[pspp-builds.git] / src / getline.c
index b5d87bc32d5c69b7ffbe25f88d50dec0947710c2..d0170980096160a65d7f26b756f5018cafc883e0 100644 (file)
@@ -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
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA. */
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA. */
 
 #include <config.h>
 #include "getline.h"
@@ -24,6 +24,7 @@
 #include <errno.h>
 #include <stdlib.h>
 #include "alloc.h"
+#include "command.h"
 #include "error.h"
 #include "filename.h"
 #include "lexer.h"
@@ -43,6 +44,10 @@ int getl_welcomed;
 int getl_mode;
 int getl_prompt;
 
+#if HAVE_LIBREADLINE
+#include <readline/readline.h>
+#endif
+
 #if HAVE_LIBHISTORY
 static char *history_file;
 
@@ -57,6 +62,7 @@ extern int write_history (char *);
 #endif /* no readline/history.h */
 #endif /* -lhistory */
 
+
 extern struct cmd_set cmd;
 
 static struct string getl_include_path;
@@ -75,6 +81,9 @@ getl_initialize (void)
   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. */
@@ -469,6 +478,8 @@ read_console (void)
   ds_clear (&getl_buf);
   ds_puts (&getl_buf, line);
 
+  free (line);
+
   return 1;
 }
 #else /* no -lreadline */