From 8acaa7445af020e89dd14992576730ac5cae609a Mon Sep 17 00:00:00 2001 From: jshepher <> Date: Sat, 4 Dec 2004 00:51:39 +0000 Subject: [PATCH] Provide pre-V37 compatibility. --- libnix/sources/nix/stdlib/system.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libnix/sources/nix/stdlib/system.c b/libnix/sources/nix/stdlib/system.c index 95b7fc6..d301354 100755 --- a/libnix/sources/nix/stdlib/system.c +++ b/libnix/sources/nix/stdlib/system.c @@ -1,12 +1,18 @@ #include #include #include +#include int system(const char *string) { static struct TagItem notags[]={ { TAG_END,0 } }; - if(!string) - return 1; + if(string == NULL) { + errno = EINVAL; + return -1; + } + + if (((struct Library *)DOSBase)->lib_Version >= 36) + return SystemTagList((char *)string, notags); else - return SystemTagList((char *)string,notags); + return (int)~Execute((STRPTR)string, 0l, Output()); }