zsh-workers
 help / color / mirror / code / Atom feed
* Re: ${-str}
@ 2000-05-15  9:28 Sven Wischnowsky
  2000-05-15 10:01 ` ${-str} Peter Stephenson
  2000-05-15 15:02 ` PATCH: ${-str} Peter Stephenson
  0 siblings, 2 replies; 5+ messages in thread
From: Sven Wischnowsky @ 2000-05-15  9:28 UTC (permalink / raw)
  To: zsh-workers


Geoff Wing wrote:

> Tanaka Akira <akr@m17n.org> typed:
> :Z(4):akr@serein% Src/zsh -f             
> :serein% print -lr ${-str}
> :569XZfims
> :serein% 
> :
> :Hm.  What's `569XZfims'?
> 
> Looks like short option list to me.
> 
> % zsh -f
> % echo ${-}
> 569XZfims
> % setopt rcs; echo ${-}
> 569XZims
> % setopt norcs; echo ${-}
> 569XZfims
> 
> Src/options.c or the manual has a list.

Yep. The same as for the other special parameters (`${$foo}').
Shouldn't we change this to be an error? Or do we really need this for 
compatibility?

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

* Re: ${-str}
  2000-05-15  9:28 ${-str} Sven Wischnowsky
@ 2000-05-15 10:01 ` Peter Stephenson
  2000-05-15 15:02 ` PATCH: ${-str} Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-05-15 10:01 UTC (permalink / raw)
  To: Zsh hackers list

Sven wrote: 
> Geoff Wing wrote:
> > :serein% print -lr ${-str}
> > :569XZfims
> > % setopt norcs; echo ${-}
> > 569XZfims
> 
> Yep. The same as for the other special parameters (`${$foo}').
> Shouldn't we change this to be an error? Or do we really need this for 
> compatibility?

I think this should be an error.  This was never documented behaviour and
most forms of bad parameter syntax produce complaints.

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* PATCH: Re: ${-str}
  2000-05-15  9:28 ${-str} Sven Wischnowsky
  2000-05-15 10:01 ` ${-str} Peter Stephenson
@ 2000-05-15 15:02 ` Peter Stephenson
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 2000-05-15 15:02 UTC (permalink / raw)
  To: Zsh hackers list

Sven wrote
> > Tanaka Akira <akr@m17n.org> typed:
> > :Z(4):akr@serein% Src/zsh -f             
> > :serein% print -lr ${-str}
> > :569XZfims
>
> Shouldn't we change this to be an error? Or do we really need this for 
> compatibility?

Is this correct?  All the parameter tests still seem to work.  The first
hunk simply removes an unneeded local variable.  The change already picked
up an extraneous closing brace in _vars_eq, which is also patched.

Index: Completion/Builtins/_vars_eq
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Builtins/_vars_eq,v
retrieving revision 1.6
diff -u -r1.6 _vars_eq
--- Completion/Builtins/_vars_eq	2000/05/15 00:31:20	1.6
+++ Completion/Builtins/_vars_eq	2000/05/15 15:01:42
@@ -45,7 +45,7 @@
   export) use="${${use/g/}/x/}" ;;
 esac
 
-[[ -z "${words[(r)-*f*]]}" ]] || func=f
+[[ -z "${words[(r)-*f*]}" ]] || func=f
 [[ -z "${words[(r)-*[aA]*]}" ]] || func=p
    
 for ((i=1;i<=$#use;++i)); do
Index: Src/subst.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/subst.c,v
retrieving revision 1.4
diff -u -r1.4 subst.c
--- Src/subst.c	2000/05/08 08:58:37	1.4
+++ Src/subst.c	2000/05/15 15:01:42
@@ -1463,10 +1463,12 @@
 		}
 	    }
 	    {
+#if 1
+		singsub(&s);
+#else
 		char t = s[-1];
 
 		singsub(&s);
-#if 0
 		/*
 		 * This allows # and % to be at the start of
 		 * a parameter in the substitution, which is
@@ -1543,6 +1545,10 @@
 	}
 	if (!inbrace)
 	    fstr = s;
+	else if (s != fstr && *s) {
+	    zerr("garbage in parameter substitution: %s", s, 0);
+	    return NULL;
+	}
     }
     if (errflag)
 	return NULL;

-- 
Peter Stephenson <pws@cambridgesiliconradio.com>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070


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

* Re: ${-str}
  2000-05-13 22:56 ${-str} Tanaka Akira
@ 2000-05-15  8:04 ` Geoff Wing
  0 siblings, 0 replies; 5+ messages in thread
From: Geoff Wing @ 2000-05-15  8:04 UTC (permalink / raw)
  To: zsh-workers

Tanaka Akira <akr@m17n.org> typed:
:Z(4):akr@serein% Src/zsh -f             
:serein% print -lr ${-str}
:569XZfims
:serein% 
:
:Hm.  What's `569XZfims'?

Looks like short option list to me.

% zsh -f
% echo ${-}
569XZfims
% setopt rcs; echo ${-}
569XZims
% setopt norcs; echo ${-}
569XZfims

Src/options.c or the manual has a list.

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


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

* ${-str}
@ 2000-05-13 22:56 Tanaka Akira
  2000-05-15  8:04 ` ${-str} Geoff Wing
  0 siblings, 1 reply; 5+ messages in thread
From: Tanaka Akira @ 2000-05-13 22:56 UTC (permalink / raw)
  To: zsh-workers

Z(4):akr@serein% Src/zsh -f             
serein% print -lr ${-str}
569XZfims
serein% 

Hm.  What's `569XZfims'?
-- 
Tanaka Akira


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

end of thread, other threads:[~2000-05-15 15:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-15  9:28 ${-str} Sven Wischnowsky
2000-05-15 10:01 ` ${-str} Peter Stephenson
2000-05-15 15:02 ` PATCH: ${-str} Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
2000-05-13 22:56 ${-str} Tanaka Akira
2000-05-15  8:04 ` ${-str} Geoff Wing

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).