Hello,

when Firebird (at least HEAD and B2_5_Release) is built with
--with-system-editline on OpenSuSE 12.1 (libedit 3.0), history in isql
is broken: isql remembers only first character from each line.

This can be prevented by calling setlocale(LC_ALL, "") (actually,
LC_COLLATE is sufficient). I have tested attached patch on both 3.0 and
2.5 (attached version is for 3.0) but I'm not sure that it doesn't
break something on non-unix platforms.

                                                         Michal Kubecek

From: Michal Kubecek <[email protected]>
Date: Tue, 22 May 2012 20:25:34 +0200
Subject: isql: fix history with new libedit

With new versions of libedit, e.g. on OpenSuSE 12.1, setlocale()
needs to be called, otherwise history is broken (only first
character of each line is remembered).
---
 src/isql/isql.epp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/isql/isql.epp b/src/isql/isql.epp
index 17d6fe0..5300db6 100644
--- a/src/isql/isql.epp
+++ b/src/isql/isql.epp
@@ -71,6 +71,9 @@
 #ifdef HAVE_TERMIOS_H
 #include <termios.h>
 #endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
 
 //#ifdef HAVE_IO_H
 //#include <io.h> // mktemp
@@ -559,6 +562,8 @@ int ISQL_main(int argc, char* argv[])
 	}
 #endif	// MU_ISQL
 
+	setlocale(LC_ALL, "");
+
 	TEXT tabname[WORDLENGTH];
 	tabname[0] = '\0';
 	isqlGlob.db_SQL_dialect = 0;
-- 
1.7.7

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to