[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn: MIME type 'text/x-c++' ends with non-alphanumeric character

From: Stefan Sperling <stsp_at_elego.de>
Date: Sat, 26 Apr 2008 13:14:11 +0200

On Sat, Apr 26, 2008 at 12:58:30PM +0200, Stefan Sperling wrote:
>
> Thread moved to dev@
 
> Would this be better?
>
> Can anyone test if this breaks anything?
> (There seem to be no mime-type-related unit tests...)
>
> Index: subversion/libsvn_subr/validate.c
> ===================================================================
> --- subversion/libsvn_subr/validate.c (revision 30791)
> +++ subversion/libsvn_subr/validate.c (working copy)
> @@ -41,6 +41,8 @@ svn_mime_type_validate(const char *mime_type, apr_
> only looking at the media type here. */
> const apr_size_t len = strcspn(mime_type, "; ");
> const char *const slash_pos = strchr(mime_type, '/');
> + int i;
> + const char *tspecials = "()<>@,;:\\\"/[]?="; /* see RFC 1521 */

Hrmm, with that slash tspecials, looping over the whole mime-type
and just not the subtype will break the whole function pretty much :/

I'll send a better patch in a minute.

-- 
Stefan Sperling <stsp_at_elego.de>                    Software Monkey
 
German law requires the following banner :(
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                               CEO: Olaf Wagner
 
Store password unencrypted (yes/no)? No

  • application/pgp-signature attachment: stored
Received on 2008-04-26 13:13:06 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.