@@ -1580,10 +1580,6 @@ function splitShellCommands(command) {
15801580 let i = 0 ;
15811581 while ( i < tokens . length ) {
15821582 const token = tokens [ i ] ;
1583- if ( token === undefined ) {
1584- i ++ ;
1585- continue ;
1586- }
15871583 if ( isOperator ( token ) ) {
15881584 if ( current . length > 0 ) {
15891585 segments . push ( current ) ;
@@ -1714,9 +1710,6 @@ function parseEnvAssignment(token) {
17141710 return null ;
17151711 }
17161712 const eqIdx = token . indexOf ( "=" ) ;
1717- if ( eqIdx < 0 ) {
1718- return null ;
1719- }
17201713 return { name : token . slice ( 0 , eqIdx ) , value : token . slice ( eqIdx + 1 ) } ;
17211714}
17221715function stripEnvAssignmentsWithInfo ( tokens ) {
@@ -2736,6 +2729,7 @@ function parseParallelCommand(tokens) {
27362729
27372730// src/core/analyze/tmpdir.ts
27382731import { tmpdir as tmpdir2 } from "node:os" ;
2732+ import { normalize as normalize2 , sep as sep2 } from "node:path" ;
27392733function isTmpdirOverriddenToNonTemp ( envAssignments ) {
27402734 if ( ! envAssignments . has ( "TMPDIR" ) ) {
27412735 return false ;
@@ -2744,8 +2738,9 @@ function isTmpdirOverriddenToNonTemp(envAssignments) {
27442738 if ( tmpdirValue === "" ) {
27452739 return true ;
27462740 }
2747- const sysTmpdir = tmpdir2 ( ) ;
2748- if ( isPathOrSubpath ( tmpdirValue , "/tmp" ) || isPathOrSubpath ( tmpdirValue , "/var/tmp" ) || isPathOrSubpath ( tmpdirValue , sysTmpdir ) ) {
2741+ const normalizedTmpdirValue = normalize2 ( tmpdirValue ) ;
2742+ const sysTmpdir = normalize2 ( tmpdir2 ( ) ) ;
2743+ if ( isPathOrSubpath ( normalizedTmpdirValue , normalize2 ( "/tmp" ) ) || isPathOrSubpath ( normalizedTmpdirValue , normalize2 ( "/var/tmp" ) ) || isPathOrSubpath ( normalizedTmpdirValue , sysTmpdir ) ) {
27492744 return false ;
27502745 }
27512746 return true ;
@@ -2754,7 +2749,7 @@ function isPathOrSubpath(path, basePath) {
27542749 if ( path === basePath ) {
27552750 return true ;
27562751 }
2757- const baseWithSlash = basePath . endsWith ( "/" ) ? basePath : `${ basePath } / ` ;
2752+ const baseWithSlash = basePath . endsWith ( sep2 ) ? basePath : `${ basePath } ${ sep2 } ` ;
27582753 return path . startsWith ( baseWithSlash ) ;
27592754}
27602755
0 commit comments