From: Peter Stephenson <pws@cambridgesiliconradio.com>
To: zsh-workers@sunsite.auc.dk (Zsh hackers list)
Subject: PATCH: Re: ${-str}
Date: Mon, 15 May 2000 16:02:57 +0100 [thread overview]
Message-ID: <0FUL00JG9WGWSH@la-la.cambridgesiliconradio.com> (raw)
In-Reply-To: "Your message of Mon, 15 May 2000 11:28:52 +0200." <200005150928.LAA14829@beta.informatik.hu-berlin.de>
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
next prev parent reply other threads:[~2000-05-15 15:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-15 9:28 ${-str} Sven Wischnowsky
2000-05-15 10:01 ` ${-str} Peter Stephenson
2000-05-15 15:02 ` Peter Stephenson [this message]
2000-05-15 14:57 PATCH: ${-str} Sven Wischnowsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0FUL00JG9WGWSH@la-la.cambridgesiliconradio.com \
--to=pws@cambridgesiliconradio.com \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).