aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-08-29 19:35:45 +0300
committerArnold D. Robbins <arnold@skeeve.com>2013-08-29 19:35:45 +0300
commit86e23f74da247cd661c69e4bb1a5327001cc3317 (patch)
tree0959db64aacf740e0683f3cc23257c710fc80327 /debug.c
parent8d5656873bcc35003371334353c43c25d6673fb9 (diff)
downloadegawk-86e23f74da247cd661c69e4bb1a5327001cc3317.tar.gz
egawk-86e23f74da247cd661c69e4bb1a5327001cc3317.tar.bz2
egawk-86e23f74da247cd661c69e4bb1a5327001cc3317.zip
Fix issue with old readline lib on Mac OS X.
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/debug.c b/debug.c
index 29500f29..949ebb49 100644
--- a/debug.c
+++ b/debug.c
@@ -108,6 +108,12 @@ static BREAKPOINT breakpoints = { &breakpoints, &breakpoints, 0 };
static int sess_history_base = 0;
#endif
+#ifndef HAVE_HISTORY_LIST
+#define HIST_ENTRY void
+#define history_list() NULL
+#endif
+
+
/* 'list' command */
static int last_printed_line = 0;
static int last_print_count; /* # of lines printed */
@@ -4058,7 +4064,7 @@ do_dump_instructions(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
int
do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_LIST)
FILE *fp;
HIST_ENTRY **hist_list;
int i;
@@ -4282,11 +4288,6 @@ serialize_subscript(char *buf, int buflen, struct list_item *item)
static void
serialize(int type)
{
-#ifndef HAVE_LIBREADLINE
-#define HIST_ENTRY void
-#define history_list() NULL
-#endif
-
static char *buf = NULL;
static int buflen = 0;
int bl;
@@ -4400,7 +4401,7 @@ enlarge_buffer:
cndn = &wd->cndn;
break;
case HISTORY:
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) && defined(HAVE_HISTORY_LIST)
h = (HIST_ENTRY *) ptr;
nchar = strlen(h->line);
if (nchar >= buflen - bl)