summaryrefslogtreecommitdiff
path: root/src/fe-text/irssi.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-07-01 17:32:05 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-07-01 17:32:05 +0000
commitb38316c8ba9776b3db538dec6ab4faf83041b7f3 (patch)
tree1081df0236431ba76d87718a02df7f780c58134a /src/fe-text/irssi.c
parent0c712801a030a59d23d59487a064718f03a61141 (diff)
downloadirssi-b38316c8ba9776b3db538dec6ab4faf83041b7f3.zip
Moved setlocale() at the beginning of initialization, should fix regexp
crashes with non-C locale. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2858 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-text/irssi.c')
-rw-r--r--src/fe-text/irssi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index 9a5132dc..d0462aaa 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -42,6 +42,7 @@
#include "textbuffer-reformat.h"
#include <signal.h>
+#include <locale.h>
#ifdef HAVE_STATIC_PERL
void perl_core_init(void);
@@ -333,6 +334,14 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
#endif
+ /* setlocale() must be called at the beginning before any calls that
+ affect it, especially regexps seem to break if they're generated
+ before t his call.
+
+ locales aren't actually used for anything else than autodetection
+ of UTF-8 currently.. */
+ setlocale(LC_CTYPE, "");
+
textui_init();
args_register(options);
args_execute(argc, argv);