> -----Original Message-----
> From: Stefan Sperling [mailto:stsp_at_elego.de]
> Sent: vrijdag 21 oktober 2011 13:27
> To: Bert Huijben
> Cc: 'Daniel Shahaf'; 'Tomáš Bihary'; dev_at_subversion.apache.org
> Subject: Re: problems with mimetype of and empty utf8 files in svn 1.7
> Can someone run this through the windows test suite, please? Thanks.
> I don't expect any test failures from this to arise on *nix.
> Manual testing on BSD with files that contain just the UTF-8 BOM
> suggests that the patch works fine.
I tried to apply this patch and found an issue in 'svn patch'
$ svn patch f:\bom-block.patch
$ svn st
$ svn diff
--- subversion/libsvn_subr/io.c (revision 1186797)
+++ subversion/libsvn_subr/io.c (working copy)
@@ -2968,9 +2968,15 @@
/* Now close the file. No use keeping it open any more. */
+ if (amt_read == 3 && block == 0xEF && block == 0xBB && block == 0xBF
+ /* This is an empty UTF-8 file which only contains the UTF-8 BOM.
+ * Treat it as plain text. */
+ return SVN_NO_ERROR;
if (svn_io_is_binary_data(block, amt_read))
*mimetype = generic_binary;
^^^ why is that blank line removed.
For the reproduction I added the exact patch file (with windows line endings) as text and zip attachment.
Received on 2011-10-21 13:36:11 CEST