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

Commit63b0b39

Browse files
committed
Don't pass NULL to fprintf, if not currently connected to a database.
Backpatch all the way to 8.3. Fixes bug #7811, per report and diagnosis byMeng Qingzhong.
1 parent0af83bd commit63b0b39

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/bin/psql/help.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,11 @@ void
159159
slashUsage(unsigned shortintpager)
160160
{
161161
FILE*output;
162+
char*currdb;
163+
164+
currdb=PQdb(pset.db);
165+
if (currdb==NULL)
166+
currdb=_("none");
162167

163168
output=PageOutput(69,pager);
164169

@@ -171,7 +176,7 @@ slashUsage(unsigned short int pager)
171176
fprintf(output,_("General\n"));
172177
fprintf(output,_(" \\c[onnect] [DBNAME|- USER|- HOST|- PORT|-]\n"
173178
" connect to new database (currently \"%s\")\n"),
174-
PQdb(pset.db));
179+
currdb);
175180
fprintf(output,_(" \\cd [DIR] change the current working directory\n"));
176181
fprintf(output,_(" \\copyright show PostgreSQL usage and distribution terms\n"));
177182
fprintf(output,_(" \\encoding [ENCODING]\n"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp