ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.225 by root, Wed Jul 5 22:46:14 2006 UTC vs.
Revision 1.228 by root, Wed Aug 2 09:14:19 2006 UTC

56static char curlocale[128], savelocale[128]; 56static char curlocale[128], savelocale[128];
57 57
58bool 58bool
59rxvt_set_locale (const char *locale) NOTHROW 59rxvt_set_locale (const char *locale) NOTHROW
60{ 60{
61 int size = strlen (locale) + 1;
62
63 if (size > 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, size))
62 return false; 67 return false;
63 68
64 strncpy (curlocale, locale, 128); 69 memcpy (curlocale, locale, size);
65 setlocale (LC_CTYPE, curlocale); 70 setlocale (LC_CTYPE, curlocale);
66 return true; 71 return true;
67} 72}
68 73
69void 74void
143} 148}
144#endif 149#endif
145 150
146rxvt_term::rxvt_term () 151rxvt_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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines