[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] XaAES: bug(s) in shel_write()



>The problem is - where is quoting documented? How is quoting defined?
>The ARGV docs only mentions quoting when talking about empty parameters,
>and that's some extension someone (not Atari) came up with later.

Depends on where the argeuments are used. Parameters that are put into $ARGV don't need to be quoted, since they are separated by '\0'. The only problem there are empty parameters: without extra work (writing a space instead of an empty string, and putting an entry into the NULL: list), an empty parameter would lead to two consecutive zeroes, indicating the end of arguments. In mintlib this is supported by the runtime startup code (decoding) and when executing programs via some spawn() function (encoding).

Parameters that are placed directly into the command line are separated by spaces, and thus need quoting when they contain spaces. Since a apostophe is used for quoting, they also need to be quoted when they originally contained an apostophe. An apostrophe inside the parameter is then duplicated. Thats the same scheme that is used for passing parameters via VA-protocol (at least if the receiving app announces that it understands quoting), and also in the Drag&Drop protocol.


Jo Even Skarstein <joska@online.no> schrieb am 10:44 Dienstag, 16.Februar 2016:


On ma., 2016-02-15 at 12:48 +0000, Thorsten Otto wrote:

> Because if you do a Pfork(), you will have two different
> MiNT-processes with the same GEM application id. Similarly, if you

No. If you fork, you have two MiNT-processes but only the parent has a
GEM apid. If you want to use the parent's apid from the child you really
have to know what you're doing :) If both processes needs to use GEM the
child should call appl_init and get it's own apid.


> The one thing I think is to do is that when tw-call is not involved
> the 
> quote-characters appear at the callee. In this case I think XaAES
> should 
> remove them.


The problem is - where is quoting documented? How is quoting defined?
The ARGV docs only mentions quoting when talking about empty parameters,
and that's some extension someone (not Atari) came up with later.

Jo Even