summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/mod_curses.yo2
-rw-r--r--Src/Modules/curses.c12
3 files changed, 10 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 28701584d..6ddd99b24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2007-10-15  Clint Adams  <clint@zsh.org>
 
+	* 23958: Doc/Zsh/mod_curses.yo, Src/Modules/curses.c: change target
+	window to be the first argument of zcurses -a.
+
 	* 23957: Doc/Zsh/mod_curses.yo, Src/Modules/curses.c: minor fixes.
 
 2007-10-14  Clint Adams  <clint@zsh.org>
diff --git a/Doc/Zsh/mod_curses.yo b/Doc/Zsh/mod_curses.yo
index a44608289..d862546cf 100644
--- a/Doc/Zsh/mod_curses.yo
+++ b/Doc/Zsh/mod_curses.yo
@@ -6,7 +6,7 @@ The tt(zsh/curses) module makes available one builtin command:
 startitem()
 findex(zcurses)
 cindex(windows, curses)
-xitem(tt(zcurses) tt(-a) var(nlines) var(ncols) var(begin_y) var(begin_x) var(targetwin) )
+xitem(tt(zcurses) tt(-a) var(targetwin) var(nlines) var(ncols) var(begin_y) var(begin_x) )
 xitem(tt(zcurses) tt(-d) var(targetwin) )
 xitem(tt(zcurses) tt(-r) var(targetwin) )
 xitem(tt(zcurses) tt(-m) var(targetwin) var(new_y) var(new_x) )
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index 1cc711a2d..5d9364aaf 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -105,14 +105,14 @@ bin_zcurses(char *nam, char **args, Options ops, UNUSED(int func))
     if (OPT_ISSET(ops,'a')) {
 	int nlines, ncols, begin_y, begin_x;
 
-	nlines = atoi(args[0]);
-	ncols = atoi(args[1]);
-	begin_y = atoi(args[2]);
-	begin_x = atoi(args[3]);
-	targetwin = zcurses_validate_window(args[4], ZCURSES_UNUSED);
+	targetwin = zcurses_validate_window(args[0], ZCURSES_UNUSED);
+	nlines = atoi(args[1]);
+	ncols = atoi(args[2]);
+	begin_y = atoi(args[3]);
+	begin_x = atoi(args[4]);
 
 	if (targetwin == -1) {
-	    zerrnam(nam, "%s: %s", zcurses_strerror(zc_errno), args[4], 0);
+	    zerrnam(nam, "%s: %s", zcurses_strerror(zc_errno), args[0], 0);
 	    return 1;
 	}