Skip to content

Commit

Permalink
Allow dots in normalized paths (#134)
Browse files Browse the repository at this point in the history
* Allow dots in normalized paths

* Replace spaces with tabs
  • Loading branch information
waldnercharles authored Oct 29, 2023
1 parent 1fa0cbb commit cacab3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cute_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ char* cf_path_normalize(const char* path)
}
prev_was_dot = true;
} else {
if (prev_was_dot) {
spush(result, '.');
}
spush(result, c);
prev_was_dot = false;
prev_was_dotdot = false;
Expand Down
4 changes: 4 additions & 0 deletions test/test_path.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ TEST_CASE(test_path_c)
REQUIRE(sequ(s, "/"));
sfree(s);

s = spnorm("/first.last/.hidden");
REQUIRE(sequ(s, "/first.last/.hidden"));
sfree(s);

return true;
}

Expand Down

0 comments on commit cacab3a

Please sign in to comment.