diff options
Diffstat (limited to 'src/bin/psql/input.c')
| -rw-r--r-- | src/bin/psql/input.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index d28fe9c0ba4..56aa1bf702d 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -95,10 +95,10 @@ void  pg_append_history(const char *s, PQExpBuffer history_buf)  {  #ifdef USE_READLINE -	if (useHistory && s && s[0]) +	if (useHistory && s)  	{  		appendPQExpBufferStr(history_buf, s); -		if (s[strlen(s) - 1] != '\n') +		if (!s[0] || s[strlen(s) - 1] != '\n')  			appendPQExpBufferChar(history_buf, '\n');  	}  #endif  | 
