delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/05/11/10:35:18

Date: Sun, 11 May 2003 17:30:08 +0300
From: "Eli Zaretskii" <eliz AT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: sandmann AT clio DOT rice DOT edu
Message-Id: <2593-Sun11May2003173008+0300-eliz@elta.co.il>
X-Mailer: emacs 21.3.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp-workers AT delorie DOT com, dborca AT yahoo DOT com
In-reply-to: <10305110406.AA11655@clio.rice.edu> (sandmann@clio.rice.edu)
Subject: Re: DXE3 in DJGPP CVS breaks cross-compiling
References: <10305110406 DOT AA11655 AT clio DOT rice DOT edu>
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

> From: sandmann AT clio DOT rice DOT edu (Charles Sandmann)
> Date: Sat, 10 May 2003 23:06:49 -0500 (CDT)
> 
> (yes, I know it could be more defensive on buffer sizes, but I've been
> up for over 24 hours straight right now flying back from europe and I
> really don't care ;-P

How about making the buffer where you assemble the command line be 64K
long?  The transfer buffer can never be larger, not until MWDPMI hits
the street, anyway ;-)

> +static int myspawn(const char **argv)
> +{
> +  char cmd[10240];
> +  strcpy(cmd, argv[0]);
> +  argv++;
> +  while (argv[0]) {
> +    strcat(cmd, " ");
> +    strcat(cmd, argv[0]);
> +    argv++;
> +  };
> +  return system(cmd);
> +}

I have one more concern about replacing `spawn*' with `system': they
behave differently as far as argument quoting is considered.  Thus, if
some file names include whitespace or other characters that need to be
quoted (like quote characters themselves), we are up for a bumpy
ride...

To remedy this, we need to quote every arg that needs it (or maybe
just quote all of them).

- Raw text -


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