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

Re: svn commit: r1131389 - /subversion/trunk/subversion/libsvn_subr/magic.c

From: Stefan Sperling <stsp_at_elego.de>
Date: Fri, 24 Jun 2011 22:59:38 +0200

On Fri, Jun 24, 2011 at 09:49:31PM +0300, Daniel Shahaf wrote:
> > +#ifndef MAGIC_MIME_TYPE
> > + char *p;
> > +
> > + /* Strip off trailing stuff like " charset=ascii". */
> > + p = strchr(magic_mimetype, ' ');
> > + if (p)
> > + *p = '\0';
>
> What is 'magic_mimetype' here? Is it guaranteed to contain a space, or
> can it be 'text/plain;charset=ascii' ?

In all examples I've seen it was a space.
I suppose the only canonical reference on this is the libmagic
source code, since this is not standardized in any way.

> i.e., should the strchr look for a semicolon?

I would only add that if we get someone reporting a bug about it.

You see, if this value is bogus in some way, it will not pass the
subsequent mime-type syntax validation step. So we will never use it
and just fall back to what we did without libmagic.
So this is not a big issue. It's cosmetic.
Received on 2011-06-24 23:00:17 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.