| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a730cdb commit 3a682cc
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1164,8 +1164,8 @@ const posix = { | |||
| 1164 | 1164 | let resolvedPath = ''; | |
| 1165 | 1165 | let resolvedAbsolute = false; | |
| 1166 | 1166 | ||
| 1167 | - for (let i = args.length - 1; i >= -1 && !resolvedAbsolute; i--) { | ||
| 1168 | - const path = i >= 0 ? args[i] : posixCwd(); | ||
| 1167 | + for (let i = args.length - 1; i >= 0 && !resolvedAbsolute; i--) { | ||
| 1168 | + const path = args[i]; | ||
| 1169 | 1169 | validateString(path, `paths[${i}]`); | |
| 1170 | 1170 | ||
| 1171 | 1171 | // Skip empty entries | |
@@ -1178,6 +1178,13 @@ const posix = { | |||
| 1178 | 1178 | StringPrototypeCharCodeAt(path, 0) === CHAR_FORWARD_SLASH; | |
| 1179 | 1179 | } | |
| 1180 | 1180 | ||
| 1181 | + if (!resolvedAbsolute) { | ||
| 1182 | + const cwd = posixCwd(); | ||
| 1183 | + resolvedPath = `${cwd}/${resolvedPath}`; | ||
| 1184 | + resolvedAbsolute = | ||
| 1185 | + StringPrototypeCharCodeAt(cwd, 0) === CHAR_FORWARD_SLASH; | ||
| 1186 | + } | ||
| 1187 | + | ||
| 1181 | 1188 | // At this point the path should be resolved to a full absolute path, but | |
| 1182 | 1189 | // handle relative paths to be safe (might happen when process.cwd() fails) | |
| 1183 | 1190 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments