… | |
… | |
56 | static char curlocale[128], savelocale[128]; |
56 | static char curlocale[128], savelocale[128]; |
57 | |
57 | |
58 | bool |
58 | bool |
59 | rxvt_set_locale (const char *locale) NOTHROW |
59 | rxvt_set_locale (const char *locale) NOTHROW |
60 | { |
60 | { |
|
|
61 | int len = strlen (locale) + 1; |
|
|
62 | |
|
|
63 | if (len > sizeof (curlocale)) |
|
|
64 | rxvt_fatal ("locale string too long, aborting.\n"); |
|
|
65 | |
61 | if (!locale || !strncmp (locale, curlocale, 128)) |
66 | if (!locale || !memcmp (locale, curlocale, len)) |
62 | return false; |
67 | return false; |
63 | |
68 | |
64 | strncpy (curlocale, locale, 128); |
69 | memcpy (curlocale, locale, len); |
65 | setlocale (LC_CTYPE, curlocale); |
70 | setlocale (LC_CTYPE, curlocale); |
66 | return true; |
71 | return true; |
67 | } |
72 | } |
68 | |
73 | |
69 | void |
74 | void |
… | |
… | |
143 | } |
148 | } |
144 | #endif |
149 | #endif |
145 | |
150 | |
146 | rxvt_term::rxvt_term () |
151 | rxvt_term::rxvt_term () |
147 | : |
152 | : |
148 | #if TRANSPARENT |
153 | #if TRANSPARENT || ENABLE_PERL |
149 | rootwin_ev (this, &rxvt_term::rootwin_cb), |
154 | rootwin_ev (this, &rxvt_term::rootwin_cb), |
150 | #endif |
155 | #endif |
151 | #ifdef HAVE_SCROLLBARS |
156 | #ifdef HAVE_SCROLLBARS |
152 | scrollbar_ev (this, &rxvt_term::x_cb), |
157 | scrollbar_ev (this, &rxvt_term::x_cb), |
153 | #endif |
158 | #endif |
… | |
… | |
326 | im_ev.stop (display); |
331 | im_ev.stop (display); |
327 | #endif |
332 | #endif |
328 | #if HAVE_SCROLLBARS |
333 | #if HAVE_SCROLLBARS |
329 | scrollbar_ev.stop (display); |
334 | scrollbar_ev.stop (display); |
330 | #endif |
335 | #endif |
331 | #if TRANSPARENT |
336 | #if TRANSPARENT || ENABLE_PERL |
332 | rootwin_ev.stop (display); |
337 | rootwin_ev.stop (display); |
333 | #endif |
338 | #endif |
334 | incr_ev.stop (); |
339 | incr_ev.stop (); |
335 | termwin_ev.stop (display); |
340 | termwin_ev.stop (display); |
336 | vt_ev.stop (display); |
341 | vt_ev.stop (display); |
… | |
… | |
504 | XSelectInput (dpy, display->root, PropertyChangeMask); |
509 | XSelectInput (dpy, display->root, PropertyChangeMask); |
505 | check_our_parents (); |
510 | check_our_parents (); |
506 | rootwin_ev.start (display, display->root); |
511 | rootwin_ev.start (display, display->root); |
507 | } |
512 | } |
508 | #endif |
513 | #endif |
|
|
514 | #if ENABLE_PERL |
|
|
515 | rootwin_ev.start (display, display->root); |
|
|
516 | #endif |
509 | |
517 | |
510 | set_colorfgbg (); |
518 | set_colorfgbg (); |
511 | |
519 | |
512 | init_command (cmd_argv); |
520 | init_command (cmd_argv); |
513 | |
521 | |