delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/07/08/02:40:06

Date: Tue, 8 Jul 1997 09:39:13 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Molnar Laszlo <molnarl AT cdata DOT tvnet DOT hu>
cc: DJGPP Workers <djgpp-workers AT delorie DOT com>
Subject: Re: bug in system()
In-Reply-To: <33C0F8C3.2F2F4CB4@cdata.tvnet.hu>
Message-ID: <Pine.SUN.3.91.970708093819.13048A-100000@is>
MIME-Version: 1.0

On Mon, 7 Jul 1997, Molnar Laszlo wrote:

>   if (!shell)
>     shell = command_com;
> 
> like in _shell_command(), because _is_unixy_shell() can receive
> a NULL pointer which list_member() will dereference, if there is no 
> SHELL or COMSPEC environment variable

Here's the necessary patch:

*** src/libc/ansi/stdlib/system.c~0	Fri Sep 27 02:24:50 1996
--- src/libc/ansi/stdlib/system.c	Tue Jul  8 09:09:08 1997
*************** system (const char *cmdline)
*** 502,507 ****
--- 502,509 ----
      shell = getenv ("SHELL");
    if (!shell)
      shell = comspec;
+   if (!shell)
+     shell = command_com;
  
    /* Special case: NULL means just exec the command interpreter.  */
    if (cmdline == 0)

- Raw text -


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