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

Commit917042f

Browse files
committed
Remove rlstubs.[ch], since they weren't actually doing anything that couldn't
be #ifdef'd into psql.c itselfFrom what I can tell, if USE_READLINE is true or false, psql works underFreeBSD, without configure. Now to test it *again* under sparc_solariswith configure and see if it works...
1 parentaa46d53 commit917042f

File tree

4 files changed

+19
-67
lines changed

4 files changed

+19
-67
lines changed

‎src/bin/psql/Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.18 1997/01/2522:51:26 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.19 1997/01/2523:53:59 scrappy Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -50,11 +50,10 @@ ifeq ($(USE_READLINE), true)
5050
endif
5151
endif
5252
endif
53-
OBJS= psql.o stringutils.o
54-
else
55-
OBJS= psql.o stringutils.o rlstubs.o
5653
endif
5754

55+
OBJS= psql.o stringutils.o
56+
5857
ifeq ($(PORTNAME), ultrix4)
5958
OBJS+= ../../utils/strdup.o
6059
endif

‎src/bin/psql/psql.c

Lines changed: 16 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.53 1997/01/2522:51:56 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.54 1997/01/2523:54:02 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -404,7 +404,14 @@ gets_noreadline(char *prompt, FILE * source)
404404
char*
405405
gets_readline(char*prompt,FILE*source)
406406
{
407-
char*s=readline(prompt);
407+
char*s;
408+
#ifdefHAVE_LIBREADLINE
409+
s=readline(prompt);
410+
#else
411+
charbuf[500];
412+
printf("%s",prompt);
413+
s=fgets(buf,500,stdin);
414+
#endif
408415
fputc('\r',stdout);
409416
fflush(stdout);
410417
returns;
@@ -1158,8 +1165,10 @@ HandleSlashCmds(PsqlSettings * settings,
11581165
case's':/* \s is save history to a file */
11591166
if (!optarg)
11601167
optarg="/dev/tty";
1168+
#ifdefHAVE_HISTORY
11611169
if (write_history(optarg)!=0)
11621170
fprintf(stderr,"cannot write history to %s\n",optarg);
1171+
#endif
11631172
break;
11641173
case'm':/* monitor like type-setting */
11651174
if (toggle(settings,&settings->opt.standard,"standard SQL separaters and padding")) {
@@ -1254,7 +1263,9 @@ MainLoop(PsqlSettings * settings, FILE * source)
12541263
else
12551264
sprintf(settings->prompt,"%s%s",PQdb(settings->db),PROMPT);
12561265
if (settings->useReadline) {
1266+
#ifdefHAVE_HISTORY
12571267
using_history();
1268+
#endif
12581269
GetNextLine=gets_readline;
12591270
}else
12601271
GetNextLine=gets_noreadline;
@@ -1282,8 +1293,10 @@ MainLoop(PsqlSettings * settings, FILE * source)
12821293
settings->prompt[strlen(settings->prompt)-3]='=';
12831294
}
12841295
line=GetNextLine(settings->prompt,source);
1296+
#ifdefHAVE_HISTORY
12851297
if (interactive&&settings->useReadline&&line!=NULL)
12861298
add_history(line);/* save non-empty lines in history */
1299+
#endif
12871300
}
12881301

12891302
query_start=line;
@@ -1448,7 +1461,7 @@ main(int argc, char **argv)
14481461
settings.opt.pager=1;
14491462
if (!isatty(0)|| !isatty(1))
14501463
settings.quiet=settings.notty=1;
1451-
#ifndefNOREADLINE
1464+
#ifdefHAVE_LIBREADLINE
14521465
else
14531466
settings.useReadline=1;
14541467
#endif

‎src/bin/psql/rlstubs.c

Lines changed: 0 additions & 43 deletions
This file was deleted.

‎src/bin/psql/rlstubs.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp