Subject: Re: CVS commit: pkgsrc/misc/dialog
To: Alistair Crooks <agc@pkgsrc.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: pkgsrc-changes
Date: 11/08/2005 13:03:04
On Tue, 8 Nov 2005, Alistair Crooks wrote:

> On Tue, Nov 08, 2005 at 09:29:22AM -0800, Jeremy C. Reed wrote:
>> I forgot to commit, but the fix from the developer (which I believe will
>> be in next version) is:
>>
>> -           *stdin = *freopen(device, "r", stdin);
>> +           if (freopen(device, "r", stdin) == 0)
>> +               dlg_exiterr("cannot open tty-input");
>
> freopen returns a FILE *, so please compare the return value to NULL.

Please note that the above code is from Thomas Dickey. I believe it will 
be in his next release (so we can remove the patch then). A quick look at 
the dialog code, I see that the fopen(3) calls use a mix of comparing with 
NULL and with 0. I don't know why the code uses both ways. Please feel 
free to discuss this with him.

(At this time, dialog in pkgsrc is not the latest release, but the fix is 
not in dialog-1.0-20051030 either. I had updated to dialog-1.0-20051030 
originally to test on DragonFly before discussing with the developer.)

  Jeremy C. Reed

  	  	 	 Low cost press releases
 	  	 	 http://www.reedmedia.net/