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

Re: "textual binary" MIME types (was Re: file locking and binary files)

From: Matt Kraai <kraai_at_ftbfs.org>
Date: 2002-11-15 22:29:43 CET

On Fri, Nov 15, 2002 at 02:36:06PM -0600, cmpilato@collab.net wrote:
> Karl Fogel <kfogel@newton.ch.collab.net> writes:
>
> > Colin Watson <cjwatson@flatline.org.uk> writes:
> > > Are there any plans to make svn_mime_type_is_binary() more configurable,
> > > so that one can say "although this isn't text/*, I want to treat it that
> > > way anyway"? I appreciate that this is a corner case.
> >
> > For cases where we know the format is text anyway, maybe we should
> > just make svn_mime_type_is_binary() recognize that. Would it be a bad
> > thing if we changed svn_mime_type_is_binary() to return false for
> > `image/x-xbitmap'?
>
> +1. That's the correct solution.

...and here it is in patch form.

Matt

* subversion/libsvn_subr/validate.c
  (svn_mime_type_is_binary): Do not treat "image/x-xbitmap" as binary.

--- validate.c.orig Fri Nov 15 13:10:02 2002
+++ validate.c Fri Nov 15 13:11:12 2002
@@ -65,9 +65,6 @@
 svn_boolean_t
 svn_mime_type_is_binary (const char *mime_type)
 {
- return (! ( (mime_type[0] == 't')
- && (mime_type[1] == 'e')
- && (mime_type[2] == 'x')
- && (mime_type[3] == 't')
- && (mime_type[4] == '/')));
+ return (strncmp (mime_type, "text/", 5) != 0
+ && strcmp (mime_type, "image/x-xbitmap") != 0);
 }

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Nov 15 22:28:44 2002

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.