Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Remove some unused assignments/checks noticed by clang
- X-seq: zsh-workers 29283
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Mikael Magnusson <mikachu@xxxxxxxxx>
- Subject: Re: PATCH: Remove some unused assignments/checks noticed by clang
- Date: Sat, 14 May 2011 10:22:01 -0700
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=S9Wh4MQbTFLnm3a/2zcVXntyHuHkKpGTJci3I63PtuQ=; b=HnOT6XvryPER1oAlfw2Dnd1+o0avFKyYWAQ0v7U0eIK1IkC9rfOJZ9mRKAaJzCPxJa CL42OkBycnALxHFv1ObPpMNz0JZUXWu0aTxXzbE5VThIUjrXMrte8BAr7YEd/sjsjJSi QGw1bUMOEQMbW0gK32nCUaquVjhQWrlzLyHXk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=T70/YYwmUJDt+XgjB+punpKTT2ITd31OErtzLJwh4pwV42pJcovOJDdBZqdMfeYNrb xoD+9f59fAitG5cwNx8ZbDpokM8O2I9SgXpD3tvewxfZeNluFiUU0pwFRUezhBtUJygu o/z2I5XlQKb87CLOwWUkInnsjxnAYvXYOHW6c=
- In-reply-to: <1305332636-26241-1-git-send-email-mikachu@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1305332636-26241-1-git-send-email-mikachu@gmail.com>
- Sender: 4wayned@xxxxxxxxx
On Fri, May 13, 2011 at 5:23 PM, Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
> --- a/Src/Zle/compcore.c
> +++ b/Src/Zle/compcore.c
> @@ -1162,7 +1162,6 @@ check_param(char *s, int set, int test)
> if (*b == '#' || *b == Pound || *b == '+')
> b++;
>
> - e = b;
> if (br) {
> while (*e == (test ? Dnull : '"'))
> e++, parq++;
That change looks wrong to me. You should remove the " = b"
initializer in the declaration:
char *b = p + 1, *e = b, *ie;
The later assignment could occur after b changes value, and thus
removing it means that e starts further back in the string.
The same comment applies to the similar change in zle_tricky.c.
> --- a/Src/Zle/computil.c
> +++ b/Src/Zle/computil.c
> @@ -4465,7 +4465,7 @@ cfp_opt_pats(char **pats, char *matcher)
> q = dupstring(q);
> t = q + strlen(q) - 1;
> if (*t == ')') {
> - for (s = t--; t > q; t--)
> + while (--t)
> if (*t == ')' || *t == '|' || *t == '~' || *t == '(')
> break;
> if (t != q && *t == '(')
That while should be while (--t > q), since indexing a string back to
0 is not a good idea.
..wayne..
Messages sorted by:
Reverse Date,
Date,
Thread,
Author