From 09ec1cc1c7f32f5c004105a8a794db3c451f47e2 Mon Sep 17 00:00:00 2001 From: Igor Klopov Date: Sun, 27 Mar 2016 20:12:35 +0300 Subject: [PATCH] doc: path.resolve ignores zero-length strings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/nodejs/node/blob/master/lib/path.js#L187 https://github.com/nodejs/node/blob/master/lib/path.js#L1189 PR-URL: https://github.com/nodejs/node/pull/5928 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Robert Jefe Lindstädt Reviewed-By: James M Snell --- doc/api/path.markdown | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/doc/api/path.markdown b/doc/api/path.markdown index 9188e042d80028..49cff7a8beb503 100644 --- a/doc/api/path.markdown +++ b/doc/api/path.markdown @@ -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. @@ -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 `'/'`.