Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Misaligned code?
- X-seq: zsh-workers 40043
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Misaligned code?
- Date: Tue, 29 Nov 2016 17:25:06 +0000
- Cms-type: 201P
- 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
- Organization: Samsung Cambridge Solution Centre
- References: <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. */
Messages sorted by:
Reverse Date,
Date,
Thread,
Author