[Mono-devel-list] Uri.cs patch

yoros at wanadoo.es yoros at wanadoo.es
Mon May 5 16:57:26 EDT 2003


On Mon, May 05, 2003 at 07:53:20PM +0900, Ian MacLean wrote:
> attached is a patch which fixes the issue where the URi.Parse method 
> fails with a standard unix style path ( eg /home/ianm/foo/foo.bar ). see 
> http://bugs.ximian.com/show_bug.cgi?id=41998 for details.
> I'm not sure if this patch is the *right* one but it does work. It would 
> be great if someone who knows this code a bit better could take a look.
> 
> Ian

> Index: Uri.cs
> ===================================================================
> RCS file: /mono/mcs/class/System/System/Uri.cs,v
> retrieving revision 1.17
> diff -u -r1.17 Uri.cs
> --- Uri.cs	20 Mar 2003 03:43:58 -0000	1.17
> +++ Uri.cs	5 May 2003 07:57:09 -0000
> @@ -725,8 +725,11 @@
>  					
>  				scheme = uriString.Substring (0, pos).ToLower ();
>  				uriString = uriString.Remove (0, pos + 1);
> -			} else 
> -				scheme = "file";			
> +			} else if ((c == '/') && (pos == 0)) {
> +				// unix bare filepath
> +				scheme = "file";
> +				uriString = @"//" + uriString;				
> +			}
>  						
>  			// 3
>  			if ((uriString.Length >= 2) && 

I think it's fixed in CVS, please take a look at CVS source and see what
it does. I think I added a "file://" when it's needed.

Regards,

    Pedro

-- 
Pedro Martínez Juliá
\  yoros at terra.es
)|    yoros at wanadoo.es
/        http://yoros.cjb.net
Socio HispaLinux #311
Usuario Linux #275438 - http://counter.li.org
GnuPG public information:  pub  1024D/74F1D3AC
Key fingerprint = 8431 7B47 D2B4 5A46 5F8E  534F 588B E285 74F1 D3AC



More information about the Mono-devel-list mailing list