From 3ef2c541f4743d0a8796a515ec8b1e1b8aa9ce7f Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Fri, 23 Aug 2019 00:02:00 -0700 Subject: [PATCH] 1. Updated failover for os.name() on linux to check DISTRIB_DESCRIPTION 2. Fixed substring bug, that chopped off the last character of os.name() --- microscript/ILibDuktape_ScriptContainer.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/microscript/ILibDuktape_ScriptContainer.c b/microscript/ILibDuktape_ScriptContainer.c index f81e366..226acb5 100644 --- a/microscript/ILibDuktape_ScriptContainer.c +++ b/microscript/ILibDuktape_ScriptContainer.c @@ -1972,7 +1972,16 @@ void ILibDuktape_ScriptContainer_OS_Push(duk_context *ctx, void *chain) tokens = lines[i].split('=');\ if (tokens[0] == 'PRETTY_NAME')\ {\ - this.promise._acc(tokens[1].substring(1, tokens[1].length - 2));\ + this.promise._acc(tokens[1].substring(1, tokens[1].length - 1));\ + break;\ + }\ + }\ + for (i in lines)\ + {\ + tokens = lines[i].split('=');\ + if (tokens[0] == 'DISTRIB_DESCRIPTION')\ + {\ + this.promise._acc(tokens[1].substring(1, tokens[1].length - 1));\ break;\ }\ }\