1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-01 05:16:05 +01:00

add some braces to avoid compiler warnings

This commit is contained in:
Peter Stephenson 2012-03-30 11:01:11 +00:00
parent fbc51c9ea7
commit 791ada572b
3 changed files with 17 additions and 8 deletions

View file

@ -1,3 +1,8 @@
2012-03-30 Peter Stephenson <pws@csr.com>
* unposted: Src/init.c: add some braces to avoid warnings from
some versions of gcc.
2012-03-29 Peter Stephenson <p.w.stephenson@ntlworld.com>
* unposted: Doc/Zsh/zle.yo: add missing parenthesis.
@ -16133,5 +16138,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
* $Revision: 1.5617 $
* $Revision: 1.5618 $
*****************************************************

View file

@ -17,6 +17,7 @@ integer pos=1 cpos=$((CURSOR+1)) opos iword ichar
bufwords=(${(Z+n+)BUFFER})
typeset -ga reply
reply=()
while [[ ${BUFFER[pos]} = [[:space:]] ]]; do
(( pos++ ))
@ -44,6 +45,7 @@ for word in "${bufwords[@]}"; do
fi
done
typeset -g REPLY REPLY2
if (( iword == 0 )); then
# At the end of the line, so off the indexable positions
# (but still a valid cursor position).

View file

@ -341,12 +341,13 @@ parseopts(char *nam, char ***argvp)
if (!(optno = optlookup(*argv))) {
WARN_OPTION("no such option: %s", *argv);
LAST_OPTION(1);
} else if (optno == RESTRICTED && !nam)
} else if (optno == RESTRICTED && !nam) {
restricted = action;
else if ((optno == EMACSMODE || optno == VIMODE) && nam)
} else if ((optno == EMACSMODE || optno == VIMODE) && nam) {
WARN_OPTION("can't change option: %s", *argv);
else if (dosetopt(optno, action, !nam) && nam)
} else if (dosetopt(optno, action, !nam) && nam) {
WARN_OPTION("can't change option: %s", *argv);
}
break;
} else if (isspace(STOUC(**argv))) {
/* zsh's typtab not yet set, have to use ctype */
@ -361,12 +362,13 @@ parseopts(char *nam, char ***argvp)
if (!(optno = optlookupc(**argv))) {
WARN_OPTION("bad option: -%c", **argv);
LAST_OPTION(1);
} else if (optno == RESTRICTED && !nam)
} else if (optno == RESTRICTED && !nam) {
restricted = action;
else if ((optno == EMACSMODE || optno == VIMODE) && nam)
} else if ((optno == EMACSMODE || optno == VIMODE) && nam) {
WARN_OPTION("can't change option: %s", *argv);
else if (dosetopt(optno, action, !nam) && nam)
} else if (dosetopt(optno, action, !nam) && nam) {
WARN_OPTION("can't change option: -%c", **argv);
}
}
}
argv++;
@ -383,7 +385,7 @@ parseopts(char *nam, char ***argvp)
*argvp = argv;
return cmd;
}
/**/
static void
printhelp(void)