Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Compilation error in Src/Modules/curses.c on HP-UX
- X-seq: zsh-workers 24273
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxxxxx>
- Subject: Re: Compilation error in Src/Modules/curses.c on HP-UX
- Date: Sun, 16 Dec 2007 17:42:31 -0800
- In-reply-to: <20071217004133.GB11772@sverige>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <21585.1197814087@pws-pc> <20071216173733.GM982@xxxxxxxxxxxxxxxxxxx> <20071216193143.ac75ef46.p.w.stephenson@xxxxxxxxxxxx> <20071217004133.GB11772@sverige>
On Mon, Dec 17, 2007 at 12:41:33AM +0000, Paul Ackersviller wrote:
> 1332 if (getyx(w->win, intarr[0], intarr[1]) == ERR ||
> 1333 getbegyx(w->win, intarr[2], intarr[3]) == ERR ||
> 1334 getmaxyx(w->win, intarr[4], intarr[5]) == ERR)
These are all defined as returning void in both the linux docs and hp
docs that I checked. So this checking of the return values is illegal.
I didn't check-in the attached patch because my zsh build isn't building
this code.
..wayne..
--- Src/Modules/curses.c 14 Dec 2007 15:14:07 -0000 1.43
+++ Src/Modules/curses.c 17 Dec 2007 01:36:15 -0000
@@ -1329,9 +1329,14 @@ zccmd_position(const char *nam, char **a
w = (ZCWin)getdata(node);
/* Look no pointers: these are macros. */
- if (getyx(w->win, intarr[0], intarr[1]) == ERR ||
- getbegyx(w->win, intarr[2], intarr[3]) == ERR ||
- getmaxyx(w->win, intarr[4], intarr[5]) == ERR)
+ getyx(w->win, intarr[0], intarr[1]);
+ if (intarr[0] == -1)
+ return 1;
+ getbegyx(w->win, intarr[2], intarr[3]);
+ if (intarr[2] == -1)
+ return 1;
+ getmaxyx(w->win, intarr[4], intarr[5]);
+ if (intarr[4] == -1)
return 1;
array = (char **)zalloc(7*sizeof(char *));
Messages sorted by:
Reverse Date,
Date,
Thread,
Author