Re: Hard to find memo bug (Was: Visor Support)



Index: conduits/memo_file/memo_file_conduit.c
===================================================================
RCS file: /cvs/gnome/gnome-pilot/conduits/memo_file/memo_file_conduit.c,v
retrieving revision 1.31
diff -u -r1.31 memo_file_conduit.c
--- conduits/memo_file/memo_file_conduit.c	2000/07/06 07:20:02	1.31
+++ conduits/memo_file/memo_file_conduit.c	2000/07/06 12:20:47
@@ -241,6 +241,7 @@
 	
 	if(!local) return;
 	if (local->local.attr==GnomePilotRecordDeleted) return;
+	if (local->length == 0) return;
 	
 	LOG("spool_foreach");
 	generate_name(local,abs);
@@ -249,7 +250,7 @@
 	else mode=GET_CONDUIT_CFG(abs)->file_mode;
 	f = open(local->filename,O_WRONLY|O_CREAT|O_TRUNC,mode);
 	g_return_if_fail(f!=-1);
-	write(f,local->record,(local->length-1 > 0) ? local->length-1 : 0);
+	write(f,local->record, local->length-1);
 	close(f);
 	
 	f = open(idfile_name(local->category,abs),O_WRONLY|O_APPEND|O_CREAT,0600);
Eskil Heyn Olsen <eskil@eazel.com> writes:

> Please send patches to the mailing list and/or directly to me and Vadim.

Ok, I ditched the first patch in favor of this one.  If you want
detailed information (including exactly why it occurs) see bug 7816,
but basically the first patch was creating zero byte files which I
felt was rather pointless so I backed out the previous changes and
made it treat zero byte memos the same as deleted ones..

-- 
Christopher A. Craig <ccraig@ccraig.org>
"Efficiency is intelligent laziness" Arnold H. Glasow
http://www.ccraig.org


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