Commit eea20ff4 by whitequark Committed by Eddie Hung

Add support for WASI platform in cmdCheckShellEscape.

Since cmdCheckShellEscape doesn't actually report failure in any way,
this code simulates a situation where system() never succeeds.
parent 09607e90
...@@ -52,6 +52,9 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) ...@@ -52,6 +52,9 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv)
int RetValue; int RetValue;
if (argv[0][0] == '!') if (argv[0][0] == '!')
{ {
#if defined(__wasm)
RetValue = -1;
#else
const int size = 4096; const int size = 4096;
int i; int i;
char * buffer = ABC_ALLOC(char, 10000); char * buffer = ABC_ALLOC(char, 10000);
...@@ -70,7 +73,7 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv) ...@@ -70,7 +73,7 @@ int cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv)
// the parts, we lose information. So a command like // the parts, we lose information. So a command like
// `!ls "file name"` will be sent to the system as // `!ls "file name"` will be sent to the system as
// `ls file name` which is a BUG // `ls file name` which is a BUG
#endif
return 1; return 1;
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment