Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ See docs/process.md for more on how version tagging works.

3.1.75 (in development)
-----------------------
- `PATH.basename()` no longer calls `PATH.normalize()`, so that
`PATH.basename("a/.")` returns `"."` instead of `"a"` and
`PATH.basename("a/b/..")` returns `".."` instead of `"a"`. This is in line with
the behaviour of both node and coreutils, and is already the case when using
NODERAWFS". (#23180)

3.1.74 - 12/14/24
-----------------
Expand Down
5 changes: 2 additions & 3 deletions src/library_path.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,9 @@ addToLibrary({
return root + dir;
},
basename: (path) => {
// EMSCRIPTEN return '/'' for '/', not an empty string
// EMSCRIPTEN return '/' for '/', not an empty string
if (path === '/') return '/';
path = PATH.normalize(path);
path = path.replace(/\/$/, "");
path = path.replace(/\/+$/g, "");
var lastSlash = path.lastIndexOf('/');
if (lastSlash === -1) return path;
return path.substr(lastSlash+1);
Expand Down
Loading