CVS: sylpheedclaws/sylpheed-claws/src partial_download.c,1.1.2.14,1.1.2.15

[email protected] Mon, 25 Dec 2006 21:10:14 +0000
Newsgroups gmane.mail.sylpheed.claws.cvs
Message-ID <[email protected]>
Update of /pack/anoncvs/sylpheedclaws/sylpheed-claws/src
In directory sunsite.dk:/tmp/cvs-serv25407/src

Modified Files:
      Tag: gtk2
	partial_download.c 
Log Message:
2006-12-25 [colin]	2.6.1cvs69

	* src/partial_download.c
		Fix marking for download or deletion
		when the header isn't the first
	* src/gtk/logwindow.c
		Fix start of scrolling

Index: partial_download.c
===================================================================
RCS file: /pack/anoncvs/sylpheedclaws/sylpheed-claws/src/partial_download.c,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -d -r1.1.2.14 -r1.1.2.15
--- partial_download.c	2006/11/07 10:39:11	1.1.2.14
+++ partial_download.c	2006/12/25 21:10:10	1.1.2.15
@@ -257,20 +257,19 @@
 		goto bail;
 	}
 	
-	while ((len = fread(buf, sizeof(gchar), sizeof(buf)-1, fp)) > 0) {
-		buf[len]='\0';
-		if (start) {
-			start = FALSE;
-			fprintf(fpnew, "SC-Marked-For-Download: %d\n", 
-					download);
-			
-			if(strlen(buf) > strlen("SC-Marked-For-Download: x\n")
-			&& !strncmp(buf, "SC-Marked-For-Download:", 
-			            strlen("SC-Marked-For-Download:"))) {
-				fprintf(fpnew, "%s", 
-				 buf+strlen("SC-Marked-For-Download: x\n"));
-				continue;
-			}
+	fprintf(fpnew, "SC-Marked-For-Download: %d\n", 
+			download);
+	while (fgets(buf, sizeof(buf)-1, fp) != NULL) {
+		if(strlen(buf) > strlen("SC-Marked-For-Download: x\n")
+		&& !strncmp(buf, "SC-Marked-For-Download:", 
+		            strlen("SC-Marked-For-Download:"))) {
+			fprintf(fpnew, "%s", 
+			 buf+strlen("SC-Marked-For-Download: x\n"));
+			continue;
+		} else if (strlen(buf) == strlen("SC-Marked-For-Download: x\n")
+		&& !strncmp(buf, "SC-Marked-For-Download:", 
+		            strlen("SC-Marked-For-Download:"))) {
+			continue;
 		}
 		fprintf(fpnew, "%s", buf);
 	}