--- rxvt-unicode/src/rxvtc.C 2004/12/20 16:44:31 1.14 +++ rxvt-unicode/src/rxvtc.C 2005/02/14 20:46:47 1.15 @@ -65,8 +65,6 @@ main (int argc, const char *const *argv) { client c; - char buf[PATH_MAX]; - { sigset_t ss; @@ -76,8 +74,17 @@ } c.send ("NEW"); + // instead of getcwd we could opendir (".") and pass the fd for fchdir *g* - c.send ("CWD"), c.send (getcwd (buf, sizeof (buf))); + char cwd[PATH_MAX]; + + if (!getcwd (cwd, sizeof (cwd))) + { + perror ("unable to determine current working directory"); + exit (EXIT_FAILURE); + } + + c.send ("CWD"), c.send (cwd); for (char **var = environ; *environ; environ++) c.send ("ENV"), c.send (*environ);