index 6628c0c30cb6974534eca3d63c241543e946f201..ec0e6e1d49bc253193b934046cc6d6dc9ff1b2fe 100644 (file)
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