--- rxvt-unicode/src/main.C 2006/01/10 18:09:22 1.169 +++ rxvt-unicode/src/main.C 2006/01/12 00:35:39 1.175 @@ -286,14 +286,10 @@ } // TODO: free pixcolours, colours should become part of rxvt_display - delete pix_colors_focused; #if OFF_FOCUS_FADING delete pix_colors_unfocused; #endif -#if USE_XGETDEFAULT - XrmDestroyDatabase (xrmdatabase); -#endif displays.put (display); @@ -484,6 +480,7 @@ rxvt_term::init (int argc, const char *const *argv) { SET_R (this); + TEMP_ENV; // few things in X do not call setlocale :( set_locale (""); @@ -528,6 +525,7 @@ } #endif rxvt_perl.init (); + setlocale (LC_CTYPE, curlocale); // perl init destroys this info HOOK_INVOKE ((this, HOOK_INIT, DT_END)); } #endif @@ -538,7 +536,7 @@ init_xlocale (); - scr_reset (); /* initialize screen */ + scr_reset (); // initialize screen #if 0 XSynchronize (disp, True); @@ -620,9 +618,13 @@ } } sig_handlers; +char **rxvt_environ; // startup environment + void rxvt_init () { + rxvt_environ = environ; + /* * Save and then give up any super-user privileges * If we need privileges in any area then we must specifically request it. @@ -647,9 +649,7 @@ // TODO: handle this with exceptions and tolerate the memory loss XSetIOErrorHandler (rxvt_xioerror_handler); -#ifdef USE_XGETDEFAULT XrmInitialize (); -#endif } /* ------------------------------------------------------------------------- * @@ -710,24 +710,24 @@ * change effective uid/gid - not real uid/gid - so we can switch * back to root later, as required */ - seteuid (getuid ()); setegid (getgid ()); + seteuid (getuid ()); break; case SAVE: - saved_euid = geteuid (); saved_egid = getegid (); + saved_euid = geteuid (); break; case RESTORE: - seteuid (saved_euid); setegid (saved_egid); + seteuid (saved_euid); break; } # else switch (action) { case IGNORE: - setuid (getuid ()); setgid (getgid ()); + setuid (getuid ()); /* FALLTHROUGH */ case SAVE: /* FALLTHROUGH */ @@ -1453,6 +1453,8 @@ char **s; XIMStyles *xim_styles; + TEMP_ENV; + if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) return false;