Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: fix for completion with -W
- X-seq: zsh-workers 4393
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxxx
- Subject: PATCH: fix for completion with -W
- Date: Mon, 21 Sep 1998 10:41:37 +0200 (MET DST)
Hello
The patch below fixes my patch that allowed multiple directories with -W.
The problem was that -W with only one directory and a path prefix on
the line was handled incorrectly (the prefix on the line being ignored).
Bye
 Sven
*** Src/Zle/zle_tricky.c	Thu Aug 27 13:24:19 1998
--- ../Src/Zle/zle_tricky.c	Mon Sep 21 10:33:30 1998
***************
*** 3848,3854 ****
  		}
  		if (!dirs) {
  		    dirs = ta;
! 		    ta[0] = (cc->withd ? cc->withd : ppre);
  		    ta[1] = NULL;
  		}
  		while (*dirs) {
--- 3849,3864 ----
  		}
  		if (!dirs) {
  		    dirs = ta;
! 		    if (cc->withd) {
! 			char *tp;
! 			int pl = strlen(cc->withd);
! 
! 			ta[0] = tp = (char *) halloc(strlen(ppre) + pl + 2);
! 			strcpy(tp, cc->withd);
! 			tp[pl] = '/';
! 			strcpy(tp + pl + 1, ppre);
! 		    } else
! 			ta[0] = ppre;
  		    ta[1] = NULL;
  		}
  		while (*dirs) {
--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author