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

Re: Use of qualifiers without glob pattern?



> hi, all!
> 
> the question to zsh 2.6-beta21.
> 
> Man page states, that it is possible to use history modifiers for *any*
> file; to be precise: "The name of any existing file can be followed by a
> modifier of the form (:..) even if no filename generation is performed".
> 
> I have tried it in the followin statement:
> 
> for i in **/*.org
> do
>   diff -u $i $i(:r)
> done
> 
> the problem is, $i(:r) gives the same as $i!!! That is a.c.org(:r) ->
> a.c.org. If I make e.g. *.c.org(:r) I correctly get .org suffix stripped.
> 
> Is it correct? I have a feeling, that it worked in some earlier version of
> zsh.

Yes, it stopped working in beta20.  Here is the fix.

Zoltan

*** Src/glob.c	1996/06/21 14:19:05	2.24
--- Src/glob.c	1996/06/26 10:59:56
***************
*** 144,150 ****
      }
      if (*str == ':' && str[-1] == Inpar) {
  	str[-1] = '\0';
! 	modify (&ostr, &str);
  	return;
      }
      str = dupstring(ostr);
--- 144,150 ----
      }
      if (*str == ':' && str[-1] == Inpar) {
  	str[-1] = '\0';
! 	modify ((char **)&getdata(np), &str);
  	return;
      }
      str = dupstring(ostr);




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