--- rxvt-unicode/src/main.C 2006/01/11 03:13:26 1.171 +++ rxvt-unicode/src/main.C 2006/01/16 08:48:09 1.179 @@ -286,7 +286,6 @@ } // TODO: free pixcolours, colours should become part of rxvt_display - delete pix_colors_focused; #if OFF_FOCUS_FADING delete pix_colors_unfocused; @@ -380,7 +379,7 @@ void rxvt_term::destroy_cb (time_watcher &w) { - SET_R (this); + make_current (); delete this; } @@ -481,9 +480,8 @@ rxvt_term::init (int argc, const char *const *argv) { SET_R (this); - TEMP_ENV; // few things in X do not call setlocale :( - set_locale (""); + set_environ (envv); // few things in X do not call setlocale :( if (!init_vars ()) return false; @@ -525,7 +523,7 @@ } } #endif - rxvt_perl.init (); + rxvt_perl.init (this); HOOK_INVOKE ((this, HOOK_INIT, DT_END)); } #endif @@ -618,9 +616,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. @@ -706,24 +708,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 */ @@ -1449,7 +1451,7 @@ char **s; XIMStyles *xim_styles; - TEMP_ENV; + set_environ (envv); if (! ((p = XSetLocaleModifiers (modifiers)) && *p)) return false; @@ -1625,7 +1627,7 @@ char **s; char buf[IMBUFSIZ]; - SET_R (this); + make_current (); im_destroy ();