File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -1192,8 +1192,8 @@ const posix = {
11921192 let resolvedAbsolute = false ;
11931193 let slashCheck = false ;
11941194
1195- for ( let i = args . length - 1 ; i >= - 1 && ! resolvedAbsolute ; i -- ) {
1196- const path = i >= 0 ? args [ i ] : posixCwd ( ) ;
1195+ for ( let i = args . length - 1 ; i >= 0 && ! resolvedAbsolute ; i -- ) {
1196+ const path = args [ i ] ;
11971197 validateString ( path , `paths[${ i } ]` ) ;
11981198
11991199 // Skip empty entries
@@ -1215,6 +1215,13 @@ const posix = {
12151215 StringPrototypeCharCodeAt ( path , 0 ) === CHAR_FORWARD_SLASH ;
12161216 }
12171217
1218+ if ( ! resolvedAbsolute ) {
1219+ const cwd = posixCwd ( ) ;
1220+ resolvedPath = `${ cwd } /${ resolvedPath } ` ;
1221+ resolvedAbsolute =
1222+ StringPrototypeCharCodeAt ( cwd , 0 ) === CHAR_FORWARD_SLASH ;
1223+ }
1224+
12181225 // At this point the path should be resolved to a full absolute path, but
12191226 // handle relative paths to be safe (might happen when process.cwd() fails)
12201227
You can’t perform that action at this time.
0 commit comments