Re: [evolution-patches] Please review my patch for bug #44065



A uri beginning with file:// has to be followed with a hostname or a /. 
So for example file://usr/bin is really refering to the file bin on the
host usr.  Simply stripping the file:// will break resolution of a uri
like file://localhost/home/lewing/attachment.png so this fix isn't
proper.  Strictly speaking file:/home/lewing/attachment.png isn't valid
either but at least it doesn't have an ambiguous case.  Please see
RFC1738.

--Larry

On Tue, 2003-06-24 at 09:12, Antonio Xu wrote:
> Hello All,
>                Could you review my patch for bug #44065?
>                Bug Summary:evolution mailto: commandline is better also 
> to accept attachments with file:// URLs
>                I just remove "file:" form file url for fixing this bug.
> Thanks
> Antonio Xu
> 
> 
> ______________________________________________________________________
> Index: composer/e-msg-composer.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/composer/e-msg-composer.c,v
> retrieving revision 1.394
> diff -u -r1.394 e-msg-composer.c
> --- composer/e-msg-composer.c	17 Jun 2003 19:47:53 -0000	1.394
> +++ composer/e-msg-composer.c	24 Jun 2003 13:21:00 -0000
> @@ -3814,7 +3814,7 @@
>  	EMsgComposerHdrs *hdrs;
>  	GList *to = NULL, *cc = NULL, *bcc = NULL;
>  	EDestination **tov, **ccv, **bccv;
> -	char *subject = NULL, *body = NULL;
> +	char *subject = NULL, *body = NULL, *path = NULL;
>  	const char *p, *header;
>  	size_t nread, nwritten;
>  	char *content;
> @@ -3882,7 +3882,9 @@
>  					}
>  				}
>  			} else if (!strncasecmp (header, "attach", len)) {
> -				e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), content);
> +				/*Change file url to absolute path*/
> +				path = (!g_strncasecmp(content, "file:", 5)) ? content + 5 : content;
> +				e_msg_composer_attachment_bar_attach (E_MSG_COMPOSER_ATTACHMENT_BAR (composer->attachment_bar), path);
>  			} else {
>  				/* add an arbitrary header? */
>  				e_msg_composer_add_header (composer, header, content);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]