bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ~dir


From: Eli Zaretskii
Subject: Re: ~dir
Date: Mon, 4 Feb 2002 11:00:28 +0200 (IST)

On Sun, 3 Feb 2002, Devon Sean McCullough wrote:

> $ emacs -q
> C-x d / t m p RET
> + ~ f o o ~ RET
> RET
> + b a r RET
> make-directory: Creating directory: no such file or directory, 
> /tmp/~foo~/~foo~/bar

The problem was in sibstitute-in-file name.

Please try the patch below (it's against v21.1 sources, so I don't know 
if it will apply cleanly to 19.34).


*** src/fileio.old      Wed Sep 26 11:29:49 2001
--- src/fileio.c        Mon Feb  4 03:46:43 2002
*************** duplicates what `expand-file-name' does.
*** 1993,1998 ****
--- 1993,1999 ----
    int total = 0;
    int substituted = 0;
    unsigned char *xnm;
+   struct passwd *pw;
    Lisp_Object handler;
  
    CHECK_STRING (filename, 0);
*************** duplicates what `expand-file-name' does.
*** 2031,2038 ****
  #endif /* VMS */
              || IS_DIRECTORY_SEP (p[-1])))
        {
!         nm = p;
!         substituted = 1;
        }
  #ifdef DOS_NT
        /* see comment in expand-file-name about drive specifiers */
--- 2032,2058 ----
  #endif /* VMS */
              || IS_DIRECTORY_SEP (p[-1])))
        {
!         for (s = p; *s && (!IS_DIRECTORY_SEP (*s)
! #ifdef VMS
!                             && *s != ':'
! #endif /* VMS */
!                             ); s++);
!         if (s > p + 1)
!           {
!             o = (unsigned char *) alloca (s - p + 1);
!             bcopy ((char *) p, o, s - p);
!             o [s - p] = 0;
! 
!             pw = (struct passwd *) getpwnam (o + 1);
!           }
!         /* If we have ~/ or ~user and `user' exists, discard
!            everything up to ~.  But if `user' does not exist, leave
!            ~user alone, it might be a literal file name.  */
!         if (s == p + 1 || pw)
!           {
!             nm = p;
!             substituted = 1;
!           }
        }
  #ifdef DOS_NT
        /* see comment in expand-file-name about drive specifiers */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]