diff --git a/src/jobs.js b/src/jobs.js index 341b701c..554a1d0d 100644 --- a/src/jobs.js +++ b/src/jobs.js @@ -106,7 +106,7 @@ export function jobEnvironment( const value = source.CMAKE_PREFIX_PATH; const parts = typeof value === "string" && value.length <= 4096 - ? value.split(";").filter((part) => part.length > 0) + ? value.split(";") : []; if ( parts.length > 0 && diff --git a/tests/windows-job-environment.test.js b/tests/windows-job-environment.test.js index a65dae7e..d6f6e41f 100644 --- a/tests/windows-job-environment.test.js +++ b/tests/windows-job-environment.test.js @@ -126,6 +126,9 @@ test("CMAKE_PREFIX_PATH is inherited only by approved cmake commands and only wh "C:\\Qt" + String.fromCharCode(10) + "x", "C:\\" + "a".repeat(5000), ";;", + ";C:\\Qt", + "C:\\Qt;", + "C:\\Qt;;D:\\libs", ]) { assert.equal( Object.hasOwn(