From e412fa34ff172b4101893aacab94be31992fb5c6 Mon Sep 17 00:00:00 2001 From: w0rp Date: Sat, 16 Sep 2023 22:33:59 +0100 Subject: [PATCH] Fix #3115 - Fix environment variable quoting on Windows --- autoload/ale.vim | 2 +- test/test_env_function.vader | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/ale.vim b/autoload/ale.vim index 5212099e..d1c1112a 100644 --- a/autoload/ale.vim +++ b/autoload/ale.vim @@ -222,7 +222,7 @@ endfunction " valid for cmd on Windows, or most shells on Unix. function! ale#Env(variable_name, value) abort if has('win32') - return 'set ' . a:variable_name . '=' . ale#Escape(a:value) . ' && ' + return 'set ' . ale#Escape(a:variable_name . '=' . a:value) . ' && ' endif return a:variable_name . '=' . ale#Escape(a:value) . ' ' diff --git a/test/test_env_function.vader b/test/test_env_function.vader index 856a3f57..429eeae6 100644 --- a/test/test_env_function.vader +++ b/test/test_env_function.vader @@ -1,7 +1,7 @@ Execute(ale#Env should produce the correct syntax): if has('win32') AssertEqual 'set name=xxx && ', ale#Env('name', 'xxx') - AssertEqual 'set name="foo bar" && ', ale#Env('name', 'foo bar') + AssertEqual 'set "name=foo bar" && ', ale#Env('name', 'foo bar') else AssertEqual 'name=''xxx'' ', ale#Env('name', 'xxx') AssertEqual 'name=''foo bar'' ', ale#Env('name', 'foo bar')