--- rxvt-unicode/src/rxvt.h 2006/01/11 05:29:40 1.197 +++ rxvt-unicode/src/rxvt.h 2006/01/12 00:35:39 1.198 @@ -115,6 +115,38 @@ void rxvt_Draw_Triangle (Display *display, Window win, GC topShadow, GC botShadow, int x, int y, int w, int type); void rxvt_usleep (int usecs); +///////////////////////////////////////////////////////////////////////////// + +// temporarily replace the process environment +extern char **environ; +extern char **rxvt_environ; // the original environ pointer + +struct temp_environ +{ + char **prev; + + temp_environ (const stringvec *envv) + : prev(environ) + { + if (envv) + environ = (char **)envv->begin (); + } + + temp_environ (char **env) + : prev(environ) + { + if (env) + environ = env; + } + + ~temp_environ () + { + environ = prev; + } +}; + +#define TEMP_ENV temp_environ temp_environ (envv) + /* ***************************************************************************** * STRUCTURES AND TYPEDEFS @@ -700,8 +732,6 @@ #define Width2Pixel(n) ((int32_t)(n) * (int32_t)fwidth) #define Height2Pixel(n) ((int32_t)(n) * (int32_t)fheight) -#define TEMP_ENV temp_environ temp_environ (envv) - #define OPTION(opt) (options & (opt)) #define DEFAULT_OPTIONS (Opt_scrollBar | Opt_scrollTtyOutput \ | Opt_jumpScroll | Opt_secondaryScreen \