summaryrefslogtreecommitdiff
blob: 81447c4fcc07e0deceaa8f6d3e30a7c166e48f84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- /util/knewsd.c	Mon Aug 31 15:40:05 1998
+++ util/knewsd.c	Thu Aug  1 18:16:04 2002
@@ -619,6 +619,7 @@
     FILE	*fp = NULL;
     long	first, last, no;
     char	*c;
+    char	*lfl = NULL;
 
     if (!group_path) {
 	printf(CODE_TO_STR(NNTP_ERR_NCING) " Not in a newsgroup.\r\n");
@@ -677,15 +678,18 @@
 	    if (no > last)
 		break;
 
+	    lfl = strchr(buffer, '\n');
+	    if (lfl)
+		lfl[0]=0;
 	    fputs(buffer, stdout);
-	    if (!strchr(buffer, '\n')) {
+	    if (!lfl) {
 		int	ch;
 
 		while ((ch = getc(fp)) != EOF && ch != '\n')
 		    putchar(ch);
-
-		printf("\r\n");
 	    }
+
+	    printf("\r\n");
 	}
 
 	fclose(fp);