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