diff options
author | Tim Clem <timothy.clem@gmail.com> | 2012-03-05 23:21:14 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-03-06 15:39:13 +0400 |
commit | 69229e6c26e5fef43d54732421c88204a63f5aa5 (patch) | |
tree | 8eaf8482a2a3d18a9d21653997c4bdaff79dbd7b /LibGit2Sharp/TreeEntry.cs | |
parent | 4f23c3488f581191d1f4e14fcfa4623298bd6081 (diff) |
Fix up marshalling of strings returned by libgit2
Previously we were doing this which is not good:
return Marshal.PtrToStringAnsi(intPtr);
You can see the failing test that was added to ConfigurationFixture.cs to
demonstrate the problem (setting and getting a user name with unicode chars in
the config). This brought up the large problem of how we were dealing with
libgit2 methods that returned string values.
There was another subtle issue in the Utf8Marshaler where we were freeing
memory that we didn't own.
Diffstat (limited to 'LibGit2Sharp/TreeEntry.cs')
-rwxr-xr-x | LibGit2Sharp/TreeEntry.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/LibGit2Sharp/TreeEntry.cs b/LibGit2Sharp/TreeEntry.cs index d5bc5282..aa355d45 100755 --- a/LibGit2Sharp/TreeEntry.cs +++ b/LibGit2Sharp/TreeEntry.cs @@ -28,7 +28,7 @@ namespace LibGit2Sharp target = new Lazy<GitObject>(RetreiveTreeEntryTarget); Attributes = (int)NativeMethods.git_tree_entry_attributes(obj); - Name = NativeMethods.git_tree_entry_name(obj).MarshallAsString(); + Name = NativeMethods.git_tree_entry_name(obj); } /// <summary> |