AC_MSG_FAILURE(
[--with-readline was given, but test for readline failed])
fi
- ], -lncurses)])
+ ], -lncurses)
+ old_LIBS="$LIBS"
+ LIBS="$LIBS $LIBREADLINE"
+ AC_CHECK_FUNCS([append_history completion_matches rl_completion_matches])
+ LIBS="$old_LIBS"
+ ])
dnl For i18n.
AM_GNU_GETTEXT([external])
}
close (fd);
+#ifdef HAVE_APPEND_HISTORY
(void) append_history (nr_history_lines, histfile);
+#else
+ (void) write_history (histfile);
+#endif
}
#endif
}
#endif /* HAVE_LIBREADLINE */
-char **do_completion (const char *text, int start, int end)
+#ifdef HAVE_RL_COMPLETION_MATCHES
+#define RL_COMPLETION_MATCHES rl_completion_matches
+#else
+#ifdef HAVE_COMPLETION_MATCHES
+#define RL_COMPLETION_MATCHES completion_matches
+#endif
+#endif /* else just fail if we don't have either symbol */
+
+char **
+do_completion (const char *text, int start, int end)
{
char **matches = NULL;
rl_completion_append_character = ' ';
if (start == 0)
- matches = rl_completion_matches (text, generator);
+ matches = RL_COMPLETION_MATCHES (text, generator);
else if (complete_dest_paths)
- matches = rl_completion_matches (text, complete_dest_paths_generator);
+ matches = RL_COMPLETION_MATCHES (text, complete_dest_paths_generator);
#endif
return matches;