fastjar-dev
[Top][All Lists]
Advanced

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

[Fastjar-dev] [PATCH] Fastjar fails on adding one-character filenames


From: Chris Ball
Subject: [Fastjar-dev] [PATCH] Fastjar fails on adding one-character filenames
Date: Mon, 21 Dec 2009 00:32:35 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Hi,

Since 0.97, add_file_to_jar() has been testing write(2) against "1"
when deciding whether to exit, with the result that fastjar fails when
adding one-character filenames to an archive.  I think the intent was
to test against -1 (and there should really be EAGAIN/EINTR handling
here too).

Noticed when trying to build the etherpad source release at
<http://code.google.com/p/etherpad>, which fails on 0.97/0.98.

Thanks,

- Chris.

Index: jartool.c
===================================================================
RCS file: /sources/fastjar/fastjar/jartool.c,v
retrieving revision 1.59
diff -u -r1.59 jartool.c
--- jartool.c   6 Sep 2009 22:16:00 -0000       1.59
+++ jartool.c   21 Dec 2009 05:28:56 -0000
@@ -1257,7 +1257,7 @@
       exit_on_error("write");
 
   /* write the file name to the zip file */
-  if (1 == write(jfd, fname, file_name_length))
+  if (-1 == write(jfd, fname, file_name_length))
     exit_on_error("write");
 
   if(verbose){


-- 
Chris Ball   <address@hidden>
One Laptop Per Child




reply via email to

[Prev in Thread] Current Thread [Next in Thread]