zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.stephenson@samsung.com>
To: Zsh Hackers' List <zsh-workers@zsh.org>
Subject: Misaligned code?
Date: Tue, 29 Nov 2016 17:25:06 +0000	[thread overview]
Message-ID: <20161129172506.4e10dd78@pwslap01u.europe.root.pri> (raw)
In-Reply-To: <CGME20161129172508eucas1p293f705922bdb6651cfcc762869b90740@eucas1p2.samsung.com>

Is this just misaligned, as the warning says, or is there something else
going on?  I don't think it was just tab confusion, though there are
tabs around.

gcc -c -I. -I../../Src -I../../Src -I../../Src/Zle -I.  -DHAVE_CONFIG_H -DMODULE -Wall -Wmissing-prototypes -ggdb -fPIC -o computil..o computil.c
computil.c: In function ‘ca_get_opt’:
computil.c:1698:6: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
      if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
      ^~
computil.c:1702:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
   if (end) {
   ^~

pws

diff --git a/Src/Zle/computil.c b/Src/Zle/computil.c
index 0025dc3..c781673 100644
--- a/Src/Zle/computil.c
+++ b/Src/Zle/computil.c
@@ -1694,10 +1694,10 @@ ca_get_opt(Cadef d, char *line, int full, char **end)
 	for (p = d->opts; p; p = p->next)
 	    if (p->active && ((!p->args || p->type == CAO_NEXT) ?
 			      !strcmp(p->name, line) : strpfx(p->name, line))) {
-	    int l = strlen(p->name);
-	    if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
-		line[l] && line[l] != '=')
-		continue;
+		int l = strlen(p->name);
+		if ((p->type == CAO_OEQUAL || p->type == CAO_EQUAL) &&
+		    line[l] && line[l] != '=')
+		    continue;
 
 		if (end) {
 		    /* Return a pointer to the end of the option. */


       reply	other threads:[~2016-11-29 17:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20161129172508eucas1p293f705922bdb6651cfcc762869b90740@eucas1p2.samsung.com>
2016-11-29 17:25 ` Peter Stephenson [this message]
2016-11-29 20:00   ` Bart Schaefer

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=20161129172506.4e10dd78@pwslap01u.europe.root.pri \
    --to=p.stephenson@samsung.com \
    --cc=zsh-workers@zsh.org \
    /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).