-
Notifications
You must be signed in to change notification settings - Fork 41
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
RegValue.to_string() unexpectedly escapes forward slashes #52
Comments
gentoo90
added a commit
that referenced
this issue
Jul 30, 2023
Use `Display` instead of `Debug` for string and numeric values Fixes #52
CAD97
added a commit
to CAD97/nushell
that referenced
this issue
Oct 21, 2023
This was a workaround for a [bug][gentoo90/winreg-rs#52] in winreg which has since [been fixed][edf9eef] and released in [winreg v0.12.0]. winreg now properly displays strings in RegKey's Display impl instead of outputting their debug representation. We remove our `clean_string` such that registry entries which happen to start/end with " or contain \\ won't get mangled. This is very important for entries in UNC path format as those begin with a double backslash. [gentoo90/winreg-rs#52]: <gentoo90/winreg-rs#52> [edf9eef]: <gentoo90/winreg-rs@edf9eef> [winreg v0.12.0]: <https://github.com/gentoo90/winreg-rs/releases/tag/v0.12.0>
1 task
fdncred
pushed a commit
to nushell/nushell
that referenced
this issue
Oct 21, 2023
# Description Remove the `clean_string` hack used in `registry query`. This was a workaround for a [bug][gentoo90/winreg-rs#52] in winreg which has since [been fixed][edf9eef] and released in [winreg v0.12.0]. winreg now properly displays strings in RegKey's Display impl instead of outputting their debug representation. We remove our `clean_string` such that registry entries which happen to start/end with `"` or contain `\\` won't get mangled. This is very important for entries in UNC path format as those begin with a double backslash. [gentoo90/winreg-rs#52]: <gentoo90/winreg-rs#52> [edf9eef]: <gentoo90/winreg-rs@edf9eef> [winreg v0.12.0]: <https://github.com/gentoo90/winreg-rs/releases/tag/v0.12.0> # User-Facing Changes - `registry query` used to accidentally mangle values that contain a literal `\\`, such as UNC paths. It no longer does so. # Tests + Formatting - [X] `toolkit check pr` - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib`
hardfau1t
pushed a commit
to hardfau1t/nushell
that referenced
this issue
Dec 14, 2023
# Description Remove the `clean_string` hack used in `registry query`. This was a workaround for a [bug][gentoo90/winreg-rs#52] in winreg which has since [been fixed][edf9eef] and released in [winreg v0.12.0]. winreg now properly displays strings in RegKey's Display impl instead of outputting their debug representation. We remove our `clean_string` such that registry entries which happen to start/end with `"` or contain `\\` won't get mangled. This is very important for entries in UNC path format as those begin with a double backslash. [gentoo90/winreg-rs#52]: <gentoo90/winreg-rs#52> [edf9eef]: <gentoo90/winreg-rs@edf9eef> [winreg v0.12.0]: <https://github.com/gentoo90/winreg-rs/releases/tag/v0.12.0> # User-Facing Changes - `registry query` used to accidentally mangle values that contain a literal `\\`, such as UNC paths. It no longer does so. # Tests + Formatting - [X] `toolkit check pr` - 🟢 `toolkit fmt` - 🟢 `toolkit clippy` - 🟢 `toolkit test` - 🟢 `toolkit test stdlib`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I ran into an issue that I think is unexpected (or at least undocumented) behavior. I needed to convert a
RegValue
to aString
when enumerating values, and the following happened:val
ends up containing values like: "C:\foo\bar" rather thanC:\foo\bar
which is what the registry had.If I instead use the trait
FromRegValue
then I get my expectedC:\foo\bar
:Also, is there a way to convert from
RegValue
toString
usingInto<String>
rather than the custom trait? That would be nice too. I could also be misunderstanding how to use this crate as well.The text was updated successfully, but these errors were encountered: