[RFC] Don't abort when chdir'ing to a relative path

Davide "FunkyAss" Del Zompo davide.delzompo at gmail.com
Thu Jul 30 21:06:22 CEST 2015


--- On 30/07/2015 - 20:02, Marc Lehmann wrote:
> On Wed, Jul 29, 2015 at 10:55:50PM +0200, "Davide \"FunkyAss\" Del Zompo" <davide.delzompo at gmail.com> wrote:
> > Hello everybody, why does rxvt-unicode abort when a relative path is
> > given to the -cd switch?
> 
> The -cd switch was introduced for the benefit of urxvtc, which doesn't
> have a defined cwd. For urxvt, you can simply use "cd" yourself before
> starting it.
> 
> -- 
>                 The choice of a       Deliantra, the free code+content MORPG
>       -----==-     _GNU_              http://www.deliantra.net
>       ----==-- _       generation
>       ---==---(_)__  __ ____  __      Marc Lehmann
>       --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
>       -=====/_/_//_/\_,_/ /_/\_\
--- end quoted text ---

I see, sorry for the noise and the non-compiling patch.

Out of curiosity (I can accept a harsh answer), if urxvtc doesn't have a defined
cwd, how would it get past this point? from urxvtc.C +75

int
main (int argc, const char *const *argv)
{
  // instead of getcwd we could opendir (".") and pass the fd for fchdir *g*
  char cwd[PATH_MAX];

  if (!getcwd (cwd, sizeof (cwd)))
    {
      perror ("unable to determine current working directory");
      exit (STATUS_FAILURE);
    }



More information about the rxvt-unicode mailing list