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

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



Am 12.02.2016, 15:53 Uhr, schrieb Thorsten Otto:

But this patch in environ.c works:
This is a workaround for spaces in arguments, but will not handle the case of empty arguments

Empty arguments can be handled too:

if (len > 124 || strchr( arg, ' ' ) || strstr( arg, "\n\n" ) )

I don't love this solution either (just enough to fix XaAES).
Another method could be that XaAES adds an env-variable (e.g. 'FORCE_ARGV') in this case.

I also thought of setting the length-byte to 0x80 but I guess that would break lots of other code.

Apart of that empty and quoted args now work when SW_ENVIRON is set. When it's not set empty args won't work because XaAES removes the quote-characters and you end up with \0\0 for an empty argument. In this case XaAES could go on using the SW_ENVIRON-method but that would require some additional code (convert *strings[] into a "superstring" as used there) and I'm not sure if it's worth it.

Or just leave the quote-characters as is, and this way all would be the same as with SW_ENVIRON. In both cases the quote-characters arrive at the callee. Should toswin remove them?

-Helmut