forked from mirrors/tftp-hpa-google
Allow "readline" to be used even if "history" is unavailable...
This commit is contained in:
parent
a9be60cae6
commit
01acb3dc7f
4 changed files with 16 additions and 7 deletions
3
CHANGES
3
CHANGES
|
@ -16,6 +16,9 @@ Changes in 0.26:
|
||||||
|
|
||||||
Rewrite the man pages using standard "man" troff macros.
|
Rewrite the man pages using standard "man" troff macros.
|
||||||
|
|
||||||
|
Enable the (limited) use of readline on systems which don't
|
||||||
|
have readline/history.h.
|
||||||
|
|
||||||
|
|
||||||
Changes in 0.25:
|
Changes in 0.25:
|
||||||
Fixed Sorcerer's Apprentice bug in both the client and the
|
Fixed Sorcerer's Apprentice bug in both the client and the
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -56,8 +56,7 @@ acconfig.h.in: configure.in aclocal.m4
|
||||||
autoheader -f
|
autoheader -f
|
||||||
|
|
||||||
configure: configure.in aclocal.m4
|
configure: configure.in aclocal.m4
|
||||||
rm -f MCONFIG configure config.log acconfig.h
|
rm -f MCONFIG configure config.log acconfig.h config.cache
|
||||||
rm -rf *.cache
|
|
||||||
autoconf
|
autoconf
|
||||||
|
|
||||||
version.h: version
|
version.h: version
|
||||||
|
|
|
@ -151,15 +151,14 @@ PA_WITH_BOOL(readline, 1,
|
||||||
[ --without-readline disable the use of readline command-line editing],
|
[ --without-readline disable the use of readline command-line editing],
|
||||||
[
|
[
|
||||||
USE_READLINE=true
|
USE_READLINE=true
|
||||||
AC_CHECK_HEADER(readline/readline.h, [], [USE_READLINE=false])
|
AC_CHECK_HEADER(readline/readline.h,
|
||||||
AC_CHECK_HEADER(readline/history.h, [], [USE_READLINE=false])
|
[
|
||||||
if $USE_READLINE
|
|
||||||
then
|
|
||||||
AC_SEARCH_LIBS(readline, [readline history],
|
AC_SEARCH_LIBS(readline, [readline history],
|
||||||
[
|
[
|
||||||
AC_DEFINE(WITH_READLINE)
|
AC_DEFINE(WITH_READLINE)
|
||||||
])
|
])
|
||||||
fi
|
AC_CHECK_HEADERS(readline/history.h)
|
||||||
|
])
|
||||||
],:)
|
],:)
|
||||||
|
|
||||||
TFTP_LIBS="$LIBS"
|
TFTP_LIBS="$LIBS"
|
||||||
|
|
|
@ -71,8 +71,10 @@ static const char *rcsid UNUSED =
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
|
#ifdef HAVE_READLINE_HISTORY_H
|
||||||
#include <readline/history.h>
|
#include <readline/history.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "extern.h"
|
#include "extern.h"
|
||||||
|
|
||||||
|
@ -237,7 +239,9 @@ main(int argc, char *argv[])
|
||||||
(void)putchar('\n');
|
(void)putchar('\n');
|
||||||
|
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
|
#ifdef HAVE_READLINE_HISTORY_H
|
||||||
using_history();
|
using_history();
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
command();
|
command();
|
||||||
|
@ -269,7 +273,9 @@ getmoreargs(const char *partial, const char *mprompt)
|
||||||
strcpy(line, partial);
|
strcpy(line, partial);
|
||||||
strcpy(line+len, eline);
|
strcpy(line+len, eline);
|
||||||
|
|
||||||
|
#ifdef HAVE_READLINE_HISTORY_H
|
||||||
add_history(line);
|
add_history(line);
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
int len = strlen(partial);
|
int len = strlen(partial);
|
||||||
|
|
||||||
|
@ -689,7 +695,9 @@ command(void)
|
||||||
if ((line[0] == 0) || (line[0] == '\n'))
|
if ((line[0] == 0) || (line[0] == '\n'))
|
||||||
continue;
|
continue;
|
||||||
#ifdef WITH_READLINE
|
#ifdef WITH_READLINE
|
||||||
|
#ifdef HAVE_READLINE_HISTORY_H
|
||||||
add_history(line);
|
add_history(line);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
makeargv();
|
makeargv();
|
||||||
if (margc == 0)
|
if (margc == 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue