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 33 *
44 * Copyright (c) 2000-2006, PostgreSQL Global Development Group
55 *
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 $
77 */
88#include "postgres_fe.h"
99
@@ -340,7 +340,14 @@ bool
340340saveHistory (char * fname , bool encodeFlag )
341341{
342342#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 )
344351 {
345352 if (encodeFlag )
346353 encode_history ();
You can’t perform that action at this time.
0 commit comments