Skip to content

Commit 374b2b0

Browse files
committed
Why can't everyone be standard? :(
Add some code to make psql happy with a system where there is *no* history code available, but there is readline code...
1 parent d049cec commit 374b2b0

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/bin/psql/psql.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.51 1997/01/25 21:58:08 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.52 1997/01/25 22:16:36 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -35,12 +35,12 @@
3535
#else
3636
# ifdef HAVE_READLINE_H
3737
# include <readline.h>
38-
# ifdef HAVE_HISTORY_H
38+
# ifndef NO_HISTORY
3939
# include <history.h>
4040
# endif
4141
# else
4242
# include <readline/readline.h>
43-
# ifdef HAVE_READLINE_HISTORY_H
43+
# ifndef NO_HISTORY
4444
# include <readline/history.h>
4545
# endif
4646
# endif

src/include/config.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323
/* #undef HAVE_HISTORY_H */
2424
/* #undef HAVE_READLINE_HISTORY_H */
2525

26+
/* this is meant to handle the condition where the system has readline
27+
* capabilities, but no history. Unfortunately, it isn't as simple as
28+
* testing for the existance of -lhistory, since newer -lreadline seems to
29+
* include the -lhistory library, but newer readline.h doesn't
30+
*/
31+
#if defined(HAVE_LIBREADLINE)
32+
# if !defined(HAVE_HISTORY_H) || !defined(HAVE_READLINE_HISTORY_H)
33+
# define NO_HISTORY_H
34+
# endif
35+
#endif
2636

2737
#define HAVE_SYS_SELECT_H
2838
#define HAVE_TERMIOS_H

0 commit comments

Comments
 (0)