Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d4e6133

Browse files
committed
Revert commit 0725065.
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.
1 parent 2636ecf commit d4e6133

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

src/bin/psql/command.c

+1-7
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,6 @@ exec_command(const char *cmd,
289289
success = false;
290290
}
291291

292-
if (pset.dirname)
293-
free(pset.dirname);
294-
pset.dirname = pg_strdup(dir);
295-
canonicalize_path(pset.dirname);
296-
297292
if (opt)
298293
free(opt);
299294
}
@@ -1102,8 +1097,7 @@ exec_command(const char *cmd,
11021097
/* This scrolls off the screen when using /dev/tty */
11031098
success = saveHistory(fname ? fname : DEVTTY, -1, false, false);
11041099
if (success && !pset.quiet && fname)
1105-
printf(gettext("Wrote history to file \"%s/%s\".\n"),
1106-
pset.dirname ? pset.dirname : ".", fname);
1100+
printf(_("Wrote history to file \"%s\".\n"), fname);
11071101
if (!fname)
11081102
putchar('\n');
11091103
free(fname);

src/bin/psql/settings.h

-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ typedef struct _psqlSettings
8484
int sversion; /* backend server version */
8585
const char *progname; /* in case you renamed psql */
8686
char *inputfile; /* file being currently processed, if any */
87-
char *dirname; /* current directory for \s display */
88-
8987
uint64 lineno; /* also for error reporting */
9088

9189
bool timing; /* enable timing of all queries */

0 commit comments

Comments
 (0)