git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 445a612)
Make saveHistory work properly on OS X when HISTFILE is set to /dev/null.
2006年8月27日 15:05:20 +0000 (15:05 +0000)
2006年8月27日 15:05:20 +0000 (15:05 +0000)
Per discussion with Martin Atukunda.


diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 4041177e4f1c088c0e6f34485bc535f0b8c91754..3441d7813e2729cb9fc28bda7a32740cc64a73d1 100644 (file)
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.57 2006年07月14日 14:52:26 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.58 2006年08月27日 15:05:20 tgl Exp $
*/
#include "postgres_fe.h"
@@ -340,7 +340,14 @@ bool
saveHistory(char *fname, bool encodeFlag)
{
#ifdef USE_READLINE
- if (useHistory && fname)
+ /*
+ * Suppressing the write attempt when HISTFILE is set to /dev/null
+ * may look like a negligible optimization, but it's necessary on e.g.
+ * Darwin, where write_history will fail because it tries to chmod
+ * the target file.
+ */
+ if (useHistory && fname &&
+ strcmp(fname, DEVNULL) != 0)
{
if (encodeFlag)
encode_history();
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /