]> granicus.if.org Git - postgresql/commitdiff
Fix improper initialization order for readline.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Dec 2015 21:55:23 +0000 (16:55 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 17 Dec 2015 21:55:51 +0000 (16:55 -0500)
Turns out we must set rl_basic_word_break_characters *before* we call
rl_initialize() the first time, because it will quietly copy that value
elsewhere --- but only on the first call.  (Love these undocumented
dependencies.)  I broke this yesterday in commit 2ec477dc8108339d;
like that commit, back-patch to all active branches.  Per report from
Pavel Stehule.

src/bin/psql/input.c

index 14ac034b5768c19f7f4bdfe195d66905bf452422..30c580c12d34dda0ba0ab3dd5e55a380c81b3257 100644 (file)
@@ -346,8 +346,10 @@ initializeInput(int flags)
                char            home[MAXPGPATH];
 
                useReadline = true;
-               rl_initialize();
+
+               /* these two things must be done in this order: */
                initialize_readline();
+               rl_initialize();
 
                useHistory = true;
                using_history();