[Mono-dev] Patch for AssemblyNameReference Parse method

Jb Evain mono at evain.net
Wed Oct 4 12:16:55 EDT 2006


Hey Eyal,

You can commit, thanks!

Jb

Eyal Alaluf wrote:
> Hi, JB.
> 
> This is a small fix to the Parse static method of AssemblyNameReference
> where the value of PublicToken in the string is allowe to be "null".
> Let me know if you have any comments before I commit this patch.
> 
> Eyal.
> 
> 
> ------------------------------------------------------------------------
> 
> Index: Mono.Cecil/AssemblyNameReference.cs
> 
> ===================================================================
> 
> --- Mono.Cecil/AssemblyNameReference.cs	(revision 66216)
> 
> +++ Mono.Cecil/AssemblyNameReference.cs	(working copy)
> 
> @@ -159,6 +159,9 @@
> 
>  					break;
>  				case "PublicKeyToken":
>  					string pkToken = parts [1];
> +					if (pkToken == "null")
> +						break;
> +
>  					name.PublicKeyToken = new byte [pkToken.Length / 2];
>  					for (int j = 0; j < name.PublicKeyToken.Length; j++) {
>  						name.PublicKeyToken [j] = Byte.Parse (pkToken.Substring (j * 2, 2), NumberStyles.HexNumber);
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list



More information about the Mono-devel-list mailing list