Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

native: Skip non-utf16 filename on Windows #13338

Closed
wants to merge 1 commit into from

Conversation

klutzy
Copy link
Contributor

@klutzy klutzy commented Apr 5, 2014

This fixes glob::test::test_lots_of_files test on my machine:
it entered C:\$Recycle.Bin\ and there were some system files with
non-utf16 names.

This fixes `glob::test::test_lots_of_files` test on my machine:
it entered `C:\$Recycle.Bin\` and there were some system files with
non-utf16 names.
@lilyball
Copy link
Contributor

lilyball commented Apr 5, 2014

Can you give me an example of one of the names? I have a long-standing issue on my plate to reinvestigate filepaths on Windows due to rumors of non-utf16 names, but I don't have any concrete data on this.

Was it some sort of UCS2 name that's invalid UTF-16, or does Windows genuinely let you have names that aren't Unicode at all?

@klutzy
Copy link
Contributor Author

klutzy commented Apr 5, 2014

I (on win8) succeeded to create files with strange names: [0xd800, 0xdc00] (\U00010000), [0xdc00] (surrogate only) and [0xdc73, 0xdc79] (two low surrogates). The last example is even from system file of recycle bin.

@lilyball
Copy link
Contributor

lilyball commented Apr 5, 2014

@klutzy Ok thanks, that sounds like it's still valid UCS2, just not UTF-16. So it's not a big surprise.

Still, it is a reason why WindowsPath may need to move to using [u8] internally instead of str, which is unfortunate.

@alexcrichton
Copy link
Member

Interesting! I would also like to add a test for this to ensure that this doesn't crop up again. I'm also a little worried how librustuv handles this case.

I don't think that from rust you can easily create a non-utf16 filename, but you should be able to add a run-make test with a file already in the directory.

@alexcrichton
Copy link
Member

Closing due to inactivity, but feel free to reopen with a rebase!

bors added a commit that referenced this pull request Sep 7, 2014
matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this pull request Oct 11, 2022
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 7, 2024
…, r=Centri3

fix incorrect suggestion for `!(a >= b) as i32 == c`

fixes rust-lang#12761

The expression `!(a >= b) as i32 == c` got simplified to `a < b as i32 == c`, but this is a syntax error.
The result we want is `(a < b) as i32 == c`.
This is fixed by adding a parenthesis to the suggestion given in `check_simplify_not` when the boolean expression is casted.

changelog: [`nonminimal_bool`]: fix incorrect suggestion for `!(a >= b) as i32 == c`
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.

3 participants