Skip to content

Conversation

drinkcat
Copy link
Collaborator

First part of #8357. Overall, I think we should review all uses of collect_lossy(), they might all be wrong.


test_mkdir: Add a test for non-Unicode directory name

Similar to the first part of GNU test df/problematic-chars.

uutests: Change dir_exists to take a templated AsRef

Similar to what file_exists does, allows us to pass an OsStr to the
function.

Also change symlink_exists, for consistency.

mkdir: strip_minus_from_mode: Use uucore functions

Let's not reinvent stuff.

mkdir: Collect OsString, instead of String.

collect_lossy incorrectly converts invalid UTF-8 strings, let's
keep the OsString everywhere.

This also means we need to modify strip_minus_from_mode to make
it work with OsString.

uucore: Move strip_minus_from_mode to mkdir

It's only used there anyway.

drinkcat added 5 commits July 22, 2025 17:25
It's only used there anyway.
collect_lossy incorrectly converts invalid UTF-8 strings, let's
keep the OsString everywhere.

This also means we need to modify strip_minus_from_mode to make
it work with OsString.
Similar to what file_exists does, allows us to pass an OsStr to the
function.

Also change symlink_exists, for consistency.
Similar to the first part of GNU test df/problematic-chars.
@cakebaker cakebaker merged commit 8218f80 into uutils:main Jul 22, 2025
76 checks passed
@cakebaker
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants