|
From: Daniel J S. <dan...@ie...> - 2017-03-31 08:37:22
|
Does anyone have a better understanding of this comment for do_system()?
/* (am, 19980929)
* OS/2 related note: cmd.exe returns 255 if called w/o argument.
* i.e. calling a shell by "!" will always end with an error message.
* A workaround has to include checking for EMX,OS/2, two environment
* variables,...
*/
What are the environment variables? OS/2 isn't an environment variable.
There is an OS2 pre-compile flag, e.g.,:
# elif defined(OS2)
so don't we already know if this is OS2 and can adjust accordingly?
Note, when changing do_system() to int, I'm going to drop
if (!cmd)
return 0;
because both system() and _wsystem() accept NULL commands in a
meaningful way. It's a query for which a return value of 0 means no
command-processor available and not-0 means command-processor is
available. If cmd is non-NULL, then it is the usual 0 means success,
non-zero means error code.
Dan
|