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

Re: Bug in executable completion: unable to handle .. it $PATH



On Thu, 1 Jan 2009 17:24:17 +0100
"Richard Hartmann" <richih.mailinglist@xxxxxxxxx> wrote:
> [the shell won't hash paths containing ".."]

This is done explicitly in the code, but I have no idea why; it precedes
the CVS archive.  The function isrelative() is only used by hashdir().

Index: Src/exec.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/exec.c,v
retrieving revision 1.162
diff -u -r1.162 exec.c
--- Src/exec.c	17 Nov 2008 16:56:42 -0000	1.162
+++ Src/exec.c	7 Jan 2009 20:05:35 -0000
@@ -795,11 +795,16 @@
 {
     if (*s != '/')
 	return 1;
+#if 0
+    /*
+     * Eh?  .. or . in the path doesn't make the directory relative.
+     */
     for (; *s; s++)
 	if (*s == '.' && s[-1] == '/' &&
 	    (s[1] == '/' || s[1] == '\0' ||
 	     (s[1] == '.' && (s[2] == '/' || s[2] == '\0'))))
 	    return 1;
+#endif
     return 0;
 }
 
Index: Src/hashtable.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/hashtable.c,v
retrieving revision 1.30
diff -u -r1.30 hashtable.c
--- Src/hashtable.c	1 Nov 2008 01:19:35 -0000	1.30
+++ Src/hashtable.c	7 Jan 2009 20:05:35 -0000
@@ -588,7 +588,7 @@
  
 /**/
 mod_export char **pathchecked;
- 
+
 /* Create a new command hash table */
  
 /**/



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