delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2004/12/06/10:37:41

X-Authentication-Warning: delorie.com: mail set sender to djgpp-workers-bounces using -f
From: "Juan Manuel Guerrero" <st001906 AT hrz1 DOT hrz DOT tu-darmstadt DOT de>
Organization: Darmstadt University of Technology
To: djgpp-workers AT delorie DOT com
Date: Mon, 06 Dec 2004 16:36:27 +0200
MIME-Version: 1.0
Subject: Re: A fix for popen()
Message-ID: <41B48A8B.18253.35A9BAD@localhost>
In-reply-to: <200412040505.iB455Btv018175@envy.delorie.com>
References: <q1h2r0dl6evues7nrvo6r9g5j6dv2u57sm AT 4ax DOT com> (message from Brian Inglis on Fri, 03 Dec 2004 22:02:18 -0700)
X-mailer: Pegasus Mail for Windows (v4.02a, DE v4.02 R1)
X-TUD-HRZ-MailScanner: Found to be clean
X-MailScanner-From: st001906 AT hrz1 DOT hrz DOT tu-darmstadt DOT de
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Sat, 4 Dec 2004, DJ Delorie wrote:
> > the ptrs in the struct are not NULLed after allocation;
>
> Ok, *that* is the bug we should fix.

I agree, that is the way the issue should be fixed, so I propose
my first patch again.

No matter how this is fixed, the important issue is to notice that the
actual popen()/pclose() implementation is still broken and that other
packages like txi46[bds].zip, txi47[bds].zip, sed412[bds].zip, etc that
use this functionality are indeed broken too.
IMHO all these packages must be fixed either using a new djdev204 release
or including a fixed popen.c file that will be compiled with the package
sources and will replace the popen/pclose files that come with actual
djdev204.

Regards,
Juan M. Guerrero

diff -arNU5 djgpp.orig/src/libc/posix/stdio/popen.c djgpp/src/libc/posix/stdio/popen.c
--- djgpp.orig/src/libc/posix/stdio/popen.c	2004-11-30 05:08:20.000000000 +0000
+++ djgpp/src/libc/posix/stdio/popen.c	2004-12-04 18:24:54.000000000 +0000
@@ -76,10 +76,11 @@
   char *temp_name;
 
   /* make new node */
   if ((l1 = malloc(sizeof(*l1))) == NULL)
     return NULL;
+  l1->command = NULL;
 
   /* if empty list - just grab new node */
   l1->next = pl;
   pl = l1;
 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019