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

Commit0725065

Browse files
committed
This patch shows the full path name when doing a \s in psql,
if you have previously issued a \cd command.Greg Sabino Mullane
1 parent51746c4 commit0725065

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

‎src/bin/psql/command.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.144 2005/06/0915:27:26 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.145 2005/06/0923:28:09 momjian Exp $
77
*/
88
#include"postgres_fe.h"
99
#include"command.h"
@@ -276,6 +276,11 @@ exec_command(const char *cmd,
276276
success= false;
277277
}
278278

279+
if (pset.dirname)
280+
pfree(pset.dirname);
281+
pset.dirname=pg_strdup(dir);
282+
canonicalize_path(pset.dirname);
283+
279284
if (opt)
280285
free(opt);
281286
}
@@ -661,7 +666,8 @@ exec_command(const char *cmd,
661666
success=saveHistory(fname ?fname :"/dev/tty");
662667

663668
if (success&& !quiet&&fname)
664-
printf(_("Wrote history to file \"%s\".\n"),fname);
669+
printf(gettext("Wrote history to file \"%s/%s\".\n"),
670+
pset.dirname ?pset.dirname :".",fname);
665671
if (!fname)
666672
putchar('\n');
667673
free(fname);

‎src/bin/psql/settings.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright (c) 2000-2005, PostgreSQL Global Development Group
55
*
6-
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.23 2005/01/01 05:43:08 momjian Exp $
6+
* $PostgreSQL: pgsql/src/bin/psql/settings.h,v 1.24 2005/06/09 23:28:10 momjian Exp $
77
*/
88
#ifndefSETTINGS_H
99
#defineSETTINGS_H
@@ -49,6 +49,8 @@ typedef struct _psqlSettings
4949
intsversion;/* backend server version */
5050
constchar*progname;/* in case you renamed psql */
5151
char*inputfile;/* for error reporting */
52+
char*dirname;/* current directory for \s display */
53+
5254
unsignedlineno;/* also for error reporting */
5355

5456
booltiming;/* enable timing of all queries */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp