Skip to content

Commit 09ec1cc

Browse files
igorklopovjasnell
authored andcommitted
doc: path.resolve ignores zero-length strings
https://github.com/nodejs/node/blob/master/lib/path.js#L187 https://github.com/nodejs/node/blob/master/lib/path.js#L1189 PR-URL: #5928 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Robert Jefe Lindstädt <robert.lindstaedt@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 7500b68 commit 09ec1cc

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

doc/api/path.markdown

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@ If `to` isn't already absolute `from` arguments are prepended in right to left
294294
order, until an absolute path is found. If after using all `from` paths still
295295
no absolute path is found, the current working directory is used as well. The
296296
resulting path is normalized, and trailing slashes are removed unless the path
297-
gets resolved to the root directory.
297+
gets resolved to the root directory. Empty string `from` arguments are
298+
ignored.
298299

299300
Another way to think of it is as a sequence of `cd` commands in a shell.
300301

@@ -329,9 +330,6 @@ path.resolve('wwwroot', 'static_files/png/', '../gif/image.gif')
329330
// '/home/myself/node/wwwroot/static_files/gif/image.gif'
330331
```
331332

332-
*Note:* If the arguments to `resolve` have zero-length strings then the current
333-
working directory will be used instead of them.
334-
335333
## path.sep
336334

337335
The platform-specific file separator. `'\\'` or `'/'`.

0 commit comments

Comments
 (0)