Skip to content

Commit

Permalink
doc: path.resolve ignores zero-length strings
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
igorklopov authored and jasnell committed Apr 18, 2016
1 parent a974e85 commit 4c234df
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions doc/api/path.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@ If `to` isn't already absolute `from` arguments are prepended in right to left
order, until an absolute path is found. If after using all `from` paths still
no absolute path is found, the current working directory is used as well. The
resulting path is normalized, and trailing slashes are removed unless the path
gets resolved to the root directory.
gets resolved to the root directory. Empty string `from` arguments are
ignored.

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

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

*Note:* If the arguments to `resolve` have zero-length strings then the current
working directory will be used instead of them.

## path.sep

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

0 comments on commit 4c234df

Please sign in to comment.