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

delete_subkey_all() does not delete itself when subkey's path is empty. #14

Merged
merged 2 commits into from
Nov 12, 2017

Conversation

zoumi
Copy link
Contributor

@zoumi zoumi commented Oct 5, 2017

No description provided.

let c_path;
let path_ptr;
if path.as_ref().is_empty(){
path_ptr = ptr::null();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this necessary? I've just checked and it looks like RegDeleteTreeW behaves the same way with NULL pointer and pointer to an empty string in second argument. It deletes all subkeys and values in both cases.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"NULL pointer " and empty sting get the same result. The reason I add these codes is MSDN told me to to do that. BTY this avoid mem alloc in to_utf16().

@gentoo90 gentoo90 merged commit c57393f into gentoo90:master Nov 12, 2017
gentoo90 added a commit that referenced this pull request Nov 12, 2017
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