Date: Fri, 29 Jun 2001 12:50:11 +0300 From: "Eli Zaretskii" Sender: halo1 AT zahav DOT net DOT il To: "Mark E." Message-Id: <8361-Fri29Jun2001125011+0300-eliz@is.elta.co.il> X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9 CC: djgpp-workers AT delorie DOT com In-reply-to: <3B3BC9AE.12.3CD099@localhost> (snowball3@bigfoot.com) Subject: Re: v2loadimage and proxy References: <3B39E3C5 DOT 6290 DOT 765DBB AT localhost> (snowball3 AT bigfoot DOT com) <3B3BC9AE DOT 12 DOT 3CD099 AT localhost> 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 Precedence: bulk > From: "Mark E." > Date: Fri, 29 Jun 2001 00:19:58 -0400 > > I've incorporated your info into this revision: Thanks. I have only two comments: > + while (1) > + { > + if (*ptr == '\r') > + break; This means command lines cannot have embedded CR characters, which night be a subtle misfeature. I think get_arg should accept another argument, the actual length of the command line, and only stop at the CR if it is at the expected end of the command. But that begets a new problem: the first byte of cmdline cannot pass more info than about 256 bytes. So if we want to support embedded CRs, we need to extend the format of cmdline passed to v2loadimage in some way. For example, we could let command lines have a 0xFF in the first byte, and then they need to be null-terminated strings, in which case the length will be taken from strlen. I know that this is a bit of a nuisance to code, but I don't like to have limitations like no embedded CRs, especially if we now extend v2loadimage to support very long commands. However, if others think this is too much of a hassle for supporting CRs, I won't insist (provided it's documented). > + if (proxy_made) > + { > + /* When the command line is long enough to justify a proxy variable, > + set the command tail accordingly. */ > + memcpy(proxy_cmdline, cmdline, 128); > + proxy_cmdline[0] = 126; > + proxy_cmdline[127] = '\r'; > + cmdline = (const char *)proxy_cmdline; This last line seems to be a mistake, because you later have: > + /* Setup the buffer with proxy arguments. */ > + if (proxy_made) > + make_proxy_buffer(program, cmdline, proxy_argc, __tb, __tb_size); And you want the original command line to be passed to make_proxy_buffer, I think. (Actually, cmdline+1.) Last, but not least, the docs should be augmented to reflect these changes. Thanks again for working on this!