File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 3
3
*
4
4
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
5
5
*
6
- * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.57 2006/07/14 14:52:26 momjian Exp $
6
+ * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.58 2006/08/27 15:05:20 tgl Exp $
7
7
*/
8
8
#include "postgres_fe.h"
9
9
@@ -340,7 +340,14 @@ bool
340
340
saveHistory (char * fname , bool encodeFlag )
341
341
{
342
342
#ifdef USE_READLINE
343
- if (useHistory && fname )
343
+ /*
344
+ * Suppressing the write attempt when HISTFILE is set to /dev/null
345
+ * may look like a negligible optimization, but it's necessary on e.g.
346
+ * Darwin, where write_history will fail because it tries to chmod
347
+ * the target file.
348
+ */
349
+ if (useHistory && fname &&
350
+ strcmp (fname , DEVNULL ) != 0 )
344
351
{
345
352
if (encodeFlag )
346
353
encode_history ();
You can’t perform that action at this time.
0 commit comments