delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/08/06/04:29:44

Date: Mon, 6 Aug 2001 09:50:01 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Sterten <sterten AT aol DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: command tail
In-Reply-To: <20010805053449.03210.00001010@mb-mg.aol.com>
Message-ID: <Pine.SUN.3.91.1010806094942.20688G-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On 5 Aug 2001, Sterten wrote:

> how can I get the command tail in DOS-gcc203-compiled programs ?
> 
> I mean, not what argv[] makes from it, but the exact characters
> that were printed in the command line.

Like this:

    #include <sys/movedata.h>
    #include <sys/segments.h>
    #include <stubinfo.h>

    char doscmd[128];
    movedata(_stubinfo->psp_selector, 128, _my_ds(), (int)doscmd, 128);

Now doscmd[0] has the length of the command tail, while doscmd[1] to
the end is the tail itself.  Warning: it's in DOS command tail format,
and thus is not terminated by a null character!

Also note that the command tail you get from a DJGPP program invoked
by another DJGPP program will not be what you expect: it will be
something like " !proxy 0xNNNN 0xKKKK".  See section 16.4 of the FAQ
for more about this.

- Raw text -


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