delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/05/22/18:44:13

Message-ID: <338492EF.FDD@cs.com>
Date: Thu, 22 May 1997 18:41:47 +0000
From: "John M. Aldrich" <fighteer AT cs DOT com>
Reply-To: fighteer AT cs DOT com
Organization: Two pounds of chaos and a pinch of salt
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>,
DJGPP Workers Mailing List <djgpp-workers AT delorie DOT com>
Subject: Re: Bugfix for redir.c
References: <Pine DOT SUN DOT 3 DOT 91 DOT 970522182524 DOT 29094D-100000 AT is>

Eli Zaretskii wrote:
> 
> No, arguments passed by `spawn' aren't expanded on the child's side, so
> it's only an issue for `system'.  But your patch will indeed fail when the
> original arguments were quoted.  You need to quote the arguments which
> include special characters and whitespace when you reconstruct the command
> line before calling `system'.  (After you are through it, you might read
> the messy code on dosexec.c that handles it and smile.  Or maybe read it
> *before* handling the quoting, so you get a few ideas...)

Interesting.  This code would have to deal with such things as nested
quotes, escaped quotes, and other such nastiness.  For example, it would
have to reconstruct the argument 'He said "This is great"' with single
quotes instead of double quotes, or the command line will be even more
messed up than it was before.  This is probably why dosexec.c is so
messy.  ;)

I'll take a look at it and see what I can come up with.  In the
meantime, if anyone really does want to mess with the internal mechanics
of the command-line passing system used by DJGPP programs, you're
welcome to it.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I |     mailto:fighteer AT cs DOT com      |
| Descent 2: The Infinite Abyss - The greatest Internet game of all |
| time just got better!  This time, you're going all the way down...|
---------------------------------------------------------------------

- Raw text -


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