Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: no '/' after ~username in zsh-3.1.5-pws-14



Jim Graham wrote:

> Ok, I've upgraded to zsh-3.1.5-pws.14, and have noticed one problem
> that I can't seem to find anything in the man pages about...the
> examples there all say I should be seeing what I'm used to.  Based
> on that, I'm guessing that this might be a bug.  Then again, I've
> been wrong on such guesses before.  :-)
> 
> ...
> 
> Unfortunately, right now the '/' is missing after ~username, and I
> end up with
> 
> ...

It was a bug (and my fault, of course). Since, as far as I can see,
this will only happen with completion after `~' (and only when not
using the new completion system), the patch below implements the easy
solution for this.

Sorry!

Bye
 Sven

--- os/Zle/zle_tricky.c	Tue Mar 30 16:00:52 1999
+++ Src/Zle/zle_tricky.c	Thu Apr  1 10:02:44 1999
@@ -6926,14 +6926,20 @@
 	     * If it is, we append a slash.                                */
 	    struct stat buf;
 	    char *p;
+	    int t = 0;
 
-	    /* Build the path name. */
-	    p = (char *) zhalloc(strlen(prpre) + strlen(str) +
+	    if (m->ipre && m->ipre[0] == '~' && !m->ipre[1])
+		t = 1;
+	    else {
+		/* Build the path name. */
+		p = (char *) zhalloc(strlen(prpre) + strlen(str) +
 				 strlen(psuf) + 3);
-	    sprintf(p, "%s%s%s", (prpre && *prpre) ? prpre : "./", str, psuf);
+		sprintf(p, "%s%s%s", (prpre && *prpre) ? prpre : "./", str, psuf);
 
-	    /* And do the stat. */
-	    if (!(sr = ztat(p, &buf, 0)) && S_ISDIR(buf.st_mode)) {
+		/* And do the stat. */
+		t = (!(sr = ztat(p, &buf, 0)) && S_ISDIR(buf.st_mode));
+	    }
+	    if (t) {
 		/* It is a directory, so add the slash. */
 		havesuff = 1;
 		inststrlen("/", 1, 1);

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author