From d4e6133c681f0038861e5cf8707302bd80917fa0 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 5 Nov 2013 17:51:58 -0500 Subject: [PATCH] Revert commit 0725065b37b8b0e9074a624a8d3e3ac1844fc820. The previous commit was intended to make psql show the full path name when doing a \s (history save), but it was very badly implemented and would show confusing if not outright wrong information in many situations; for instance if the path name given to \s is absolute, or if \cd commands involving relative paths have been issued. Consensus seems to be that we don't especially need this functionality in \s, and certainly not in \s alone. So revert rather than trying to fix it up. Per gripe from Ian Barwick. Although the bogus behavior exists in all supported versions, I'm not back-patching, because the work created for translators (by change of a translatable message) would probably outweigh the value of what is after all a mostly-cosmetic change. --- src/bin/psql/command.c | 8 +------- src/bin/psql/settings.h | 2 -- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 0daac61e01..0b7b8d45b8 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -289,11 +289,6 @@ exec_command(const char *cmd, success = false; } - if (pset.dirname) - free(pset.dirname); - pset.dirname = pg_strdup(dir); - canonicalize_path(pset.dirname); - if (opt) free(opt); } @@ -1102,8 +1097,7 @@ exec_command(const char *cmd, /* This scrolls off the screen when using /dev/tty */ success = saveHistory(fname ? fname : DEVTTY, -1, false, false); if (success && !pset.quiet && fname) - printf(gettext("Wrote history to file \"%s/%s\".\n"), - pset.dirname ? pset.dirname : ".", fname); + printf(_("Wrote history to file \"%s\".\n"), fname); if (!fname) putchar('\n'); free(fname); diff --git a/src/bin/psql/settings.h b/src/bin/psql/settings.h index e78aa9a499..36a7a469cd 100644 --- a/src/bin/psql/settings.h +++ b/src/bin/psql/settings.h @@ -84,8 +84,6 @@ typedef struct _psqlSettings int sversion; /* backend server version */ const char *progname; /* in case you renamed psql */ char *inputfile; /* file being currently processed, if any */ - char *dirname; /* current directory for \s display */ - uint64 lineno; /* also for error reporting */ bool timing; /* enable timing of all queries */