zsh-users
 help / color / mirror / code / Atom feed
* 4.1.1 test-3
@ 2003-05-29 18:07 PeterWStephenson
  2003-06-05  0:09 ` Bad "bad pattern" in ${foo//pat/repl} ? S. Cowles
  0 siblings, 1 reply; 3+ messages in thread
From: PeterWStephenson @ 2003-05-29 18:07 UTC (permalink / raw)
  To: zsh-users

I managed to send zsh 4.1.1.test-3 to the archive in
  ftp://ftp.zsh.org/pub/development/
before our mail server went down and I had to resort to a web
interface.  This is the second one I've tried to get through
the spam filter.

This is mostly bug fixes that turned up since test-2.

One slight incompatible change is that `zle -M <keymap>'
now treats <keymap> as a an argument to -M itself
instead of taking the first regular argument.  (If
you'd read the documentation in as much detail as I did
you might have thought it did the former anyway.)
A couple of other module builtins have changed in the same way:
mkdir -p (in zsh/files), ztcp -d, zsocket -d.

One change still to go in is the current favourite way
of handling the prefix-needed style from _arguments in
the completion system.

pws

__________________________________________________________________
Try AOL and get 1045 hours FREE for 45 days!
http://free.aol.com/tryaolfree/index.adp?375380

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bad "bad pattern" in ${foo//pat/repl} ?
  2003-05-29 18:07 4.1.1 test-3 PeterWStephenson
@ 2003-06-05  0:09 ` S. Cowles
  2003-06-05  9:45   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: S. Cowles @ 2003-06-05  0:09 UTC (permalink / raw)
  To: zsh-users


almost a year ago, Bart Schaefer added the following note to the email 
archives:

================================================
From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
To: zsh-workers@xxxxxxxxxx
Subject: Bad "bad pattern" in ${foo//pat/repl} ?
Date: Sat, 13 Jul 2002 21:35:31 +0000
Mailing-list: contact zsh-workers-help@sunsite.dk; run by ezmlm
 
(Never mind why the elements of $foo have spaces in them, I was fooling
with something else when I came across this.)

schaefer<501> foo=("a b" "a c" "b q" "x y")                                    
schaefer<502> echo ${foo/#a*/yes}
yes yes b q x y
schaefer<503> echo ${foo//#a*/yes} 
a b a c b q x y
schaefer<504> setopt extendedglob 
schaefer<505> echo ${foo/#a*/yes}
yes yes b q x y
schaefer<506> echo ${foo//#a*/yes}    
zsh: bad pattern: #a*

Surely both 503 and 506 are bugs (probably the same bug).  One should be able
to anchor to the beginning of the string even when doing a replace-all (I do
admit it doesn't really make sense to do so, but ...).

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com
================================================

with 4.1.1-test-3, I am still getting the same erroneous error message for 
beginning of string operator (#), and a no-op for the end of string operator 
(%).  in each of the following examples, extendedglob is set.

03-06-04
16:44:44 [514] bubo7:scripts/zsh% a="    a b c d     " ; s=" " ; r="" ; \ 
printf "a: >%s<\n" ${a//#${s}/${r}}  
zsh: bad pattern: #
03-06-04
16:44:55 [515] bubo7:scripts/zsh% a="    a b c d     " ; s=" " ; r="" ; \ 
printf "a: >%s<\n" ${a//%${s}/${r}}   
a: >    a b c d     <

if they worked, these operations would be superb for left and right string 
trims.  the work around I've chosen is to use the read builtin to do the 
whitespace trims.  for non-whitespace trims, however, the problem remains.  
does anyone have a workaround?

scowles at earthlink dot net




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Bad "bad pattern" in ${foo//pat/repl} ?
  2003-06-05  0:09 ` Bad "bad pattern" in ${foo//pat/repl} ? S. Cowles
@ 2003-06-05  9:45   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2003-06-05  9:45 UTC (permalink / raw)
  To: zsh-users

"S. Cowles" wrote:
> almost a year ago, Bart Schaefer added the following note to the email=20
> archives:
>
> schaefer<506> echo ${foo//#a*/yes}
> zsh: bad pattern: #a*

It's a simple typo, it just got ignored.

Index: Src/subst.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/subst.c,v
retrieving revision 1.34
diff -u -r1.34 subst.c
--- Src/subst.c	22 May 2003 10:11:15 -0000	1.34
+++ Src/subst.c	5 Jun 2003 09:43:25 -0000
@@ -1420,7 +1420,7 @@
 	    if ((c = *s) == '/') {
 		/* doubled, so replace all occurrences */
 		flags |= SUB_GLOBAL;
-		s++;
+		c = *++s;
 	    }
 	    /* Check for anchored substitution */
 	    if (c == '%') {

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR Ltd., Science Park, Milton Road,
Cambridge, CB4 0WH, UK                          Tel: +44 (0)1223 692070


**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential 
and/or privileged material. 
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by 
persons or entities other than the intended recipient is 
prohibited.  
If you received this in error, please contact the sender and 
delete the material from any computer.
**********************************************************************


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-06-05 10:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-29 18:07 4.1.1 test-3 PeterWStephenson
2003-06-05  0:09 ` Bad "bad pattern" in ${foo//pat/repl} ? S. Cowles
2003-06-05  9:45   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).