Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit92f4506

Browse files
committed
The attached patch enables PostgreSQL CVS to build cleanly under Cygwin
when built against readline 4.2. Specifically, it handles the deprecationof filename_completion_function()with preference for rl_filename_completion_function()Although, I was motivated by Cygwin support, IMO this patch is appropriatefor all platforms. To quote from the readline source: #if 0 /* Backwards compatibility (compat.c). These will go away sometime. */ ... extern READLINE_EXPORT(char, *filename_completion_function) ... #endifNote that this patch is modeled after the one by Peter Eisentraut forcompletion_matches():http://www.ca.postgresql.org/~petere/readline42.htmlI tested this patch under the following environments: Cygwin with readline 4.1 Cygwin with readline 4.2 Linux with readline 2.2.1 Linux with readline 4.2and it behaved as expected.Jason Tishler
1 parent8af0ea9 commit92f4506

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

‎configure.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ AC_TRY_LINK([#include <stdio.h>
928928
AC_DEFINE(HAVE_RL_COMPLETION_APPEND_CHARACTER)],
929929
[AC_MSG_RESULT(no)])
930930

931-
AC_CHECK_FUNCS([rl_completion_matches])
931+
AC_CHECK_FUNCS([rl_completion_matches rl_filename_completion_function])
932932

933933

934934
dnl Cannot use AC_CHECK_FUNC because finite may be a macro

‎src/bin/psql/tab-complete.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.32 2001/05/08 21:06:43 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/tab-complete.c,v 1.33 2001/06/11 22:12:48 momjian Exp $
77
*/
88

99
/*----------------------------------------------------------------------
@@ -60,7 +60,9 @@
6060
#include"common.h"
6161
#include"settings.h"
6262

63-
externchar*filename_completion_function();
63+
#ifdefHAVE_RL_FILENAME_COMPLETION_FUNCTION
64+
#definefilename_completion_function rl_filename_completion_function
65+
#endif
6466

6567
#ifdefHAVE_RL_COMPLETION_MATCHES
6668
#definecompletion_matches(x,y) rl_completion_matches((x), ((rl_compentry_func_t *)(y)))

‎src/include/config.h.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* or in config.h afterwards. Of course, if you edit config.h, then your
99
* changes will be overwritten the next time you run configure.
1010
*
11-
* $Id: config.h.in,v 1.165 2001/06/02 18:25:18 petere Exp $
11+
* $Id: config.h.in,v 1.166 2001/06/11 22:12:48 momjian Exp $
1212
*/
1313

1414
#ifndefCONFIG_H
@@ -589,6 +589,9 @@ extern int fdatasync(int fildes);
589589
/* Set to 1 if you have rl_completion_matches */
590590
#undef HAVE_RL_COMPLETION_MATCHES
591591

592+
/* Set to 1 if you have rl_filename_completion_function */
593+
#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION
594+
592595
/* Set to 1 if you have getopt_long() (GNU long options) */
593596
#undef HAVE_GETOPT_LONG
594597

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp