zsh-workers
 help / color / mirror / code / Atom feed
* Misaligned code?
       [not found] <CGME20161129172508eucas1p293f705922bdb6651cfcc762869b90740@eucas1p2.samsung.com>
@ 2016-11-29 17:25 ` Peter Stephenson
  2016-11-29 20:00   ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 2016-11-29 17:25 UTC (permalink / raw)
  To: Zsh Hackers' List

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. */


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

* Re: Misaligned code?
  2016-11-29 17:25 ` Misaligned code? Peter Stephenson
@ 2016-11-29 20:00   ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2016-11-29 20:00 UTC (permalink / raw)
  To: Zsh Hackers' List

On Nov 29,  5:25pm, Peter Stephenson wrote:
}
} Is this just misaligned, as the warning says, or is there something else
} going on?

That was all added as a block by 36911, so I think it's just misaligned.


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

end of thread, other threads:[~2016-11-29 20:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20161129172508eucas1p293f705922bdb6651cfcc762869b90740@eucas1p2.samsung.com>
2016-11-29 17:25 ` Misaligned code? Peter Stephenson
2016-11-29 20:00   ` Bart Schaefer

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