about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2012-03-30 11:01:11 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2012-03-30 11:01:11 +0000
commit791ada572b5c91b17b1b3c71af48c6bf9b1ca111 (patch)
tree06b4c57a8679f47dc135db509791ed85213f817a
parentfbc51c9ea7c9350c28c6fa3d8c88576ab0e8d226 (diff)
downloadzsh-791ada572b5c91b17b1b3c71af48c6bf9b1ca111.tar.gz
zsh-791ada572b5c91b17b1b3c71af48c6bf9b1ca111.tar.xz
zsh-791ada572b5c91b17b1b3c71af48c6bf9b1ca111.zip
add some braces to avoid compiler warnings
-rw-r--r--ChangeLog7
-rw-r--r--Functions/Zle/split-shell-arguments2
-rw-r--r--Src/init.c16
3 files changed, 17 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 9837ca787..3b98fcce3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 $
 *****************************************************
diff --git a/Functions/Zle/split-shell-arguments b/Functions/Zle/split-shell-arguments
index 32b04fcb5..11a928719 100644
--- a/Functions/Zle/split-shell-arguments
+++ b/Functions/Zle/split-shell-arguments
@@ -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).
diff --git a/Src/init.c b/Src/init.c
index 1212a48d9..6f14943e1 100644
--- a/Src/init.c
+++ b/Src/init.c
@@ -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)