From 32e114c2bd6054830292b801a09f310a1418f348 Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Wed, 20 Oct 2021 20:02:13 +0100 Subject: [PATCH 1/2] Add null case to `put_env` function in sys --- libs/std/sys.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/libs/std/sys.c b/libs/std/sys.c index 1a7ce00e..55b0ff1e 100644 --- a/libs/std/sys.c +++ b/libs/std/sys.c @@ -85,20 +85,28 @@ static value get_env( value v ) { Set some environment variable value **/ static value put_env( value e, value v ) { + val_check(e,string); + bool is_null = val_is_null(v); #ifdef NEKO_WINDOWS buffer b; - val_check(e,string); - val_check(v,string); + if( !is_null ) + val_check(v,string); b = alloc_buffer(NULL); val_buffer(b,e); buffer_append_sub(b,"=",1); - val_buffer(b,v); + if( !is_null ) + val_buffer(b,v); if( putenv(val_string(buffer_to_string(b))) != 0 ) neko_error(); #else - val_check(e,string); - val_check(v,string); - if( setenv(val_string(e),val_string(v),1) != 0 ) + int result; + if( is_null ) + result = unsetenv(val_string(e)); + else { + val_check(v,string); + result = setenv(val_string(e),val_string(v),1); + } + if( result != 0 ) neko_error(); #endif return val_true; From c762658ff90adee577e7c8f83484ece3e6772dee Mon Sep 17 00:00:00 2001 From: tobil4sk Date: Wed, 20 Oct 2021 20:03:40 +0100 Subject: [PATCH 2/2] Increment version number to 2.3.1 --- CMakeLists.txt | 2 +- azure-pipelines.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 930c1ab6..96ee5229 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,7 +37,7 @@ endif() set(NEKO_VERSION_MAJOR 2) set(NEKO_VERSION_MINOR 3) -set(NEKO_VERSION_PATCH 0) +set(NEKO_VERSION_PATCH 1) set(NEKO_VERSION ${NEKO_VERSION_MAJOR}.${NEKO_VERSION_MINOR}.${NEKO_VERSION_PATCH}) # Determine target endianness diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1a66a87d..106d4ab2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -5,7 +5,7 @@ variables: - name: AZURE_PIPELINES_BRANCH value: $(Build.SourceBranchName) - name: NEKO_VERSION - value: "2.3.0" + value: "2.3.1" trigger: branches: