Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 7506 - Missing CR in output of do_xover() of knewsd
Summary: Missing CR in output of do_xover() of knewsd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Seemant Kulleen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-09-05 08:02 UTC by Achim Linder
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Achim Linder 2002-09-05 08:02:08 UTC
Package: knews-1.0b.1

The do_xover function of knewsd prints LINE-CR-LF if the line from the
.overview file is longer than 1024 characters, but it prints only the raw
line from the file (i.e. LINE-LF) if the line is shorter. This is a
problem if knewsd is used by a news client other than knews, e.g. with
knode www.geocrawler.com/archives/3/3730/2002/9/0/9501787/
The client doesn't even recognize the end of the transmission, since the
closing period is at the end of one huge "line", not at the beginning of
the last line.


--- knewsdold.c	Mon Aug 31 15:40:05 1998
+++ 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);



Achim
Comment 1 Seemant Kulleen (RETIRED) gentoo-dev 2002-09-05 16:14:20 UTC
did you send this patch upstream too?
Comment 2 Achim Linder 2002-09-06 07:48:59 UTC
I sent it to Debian and SuSE. AFAIK the upstream is no longer active.
Comment 3 Dan Armak (RETIRED) gentoo-dev 2002-09-07 07:04:43 UTC
Hm. knews is masked as "broken" since times immemorial. If it's dead upstream 
we should remove it from potage altogether, not go on fixing it. 
Comment 4 Achim Linder 2002-09-07 08:14:31 UTC
knews is probably the only GUI news reader for unix with acceptable
performance on a small box, and knewsd is the only easy way to use a
news spool with online-only news readers like knode. Debian and SuSE
still maintain knews packages for their current distributions and there
are still some people who use it, so I don't know what "broken" means in
this context.
Comment 5 Dan Armak (RETIRED) gentoo-dev 2002-09-07 15:35:25 UTC
I don' know what's so broken about it either, I think the mask is from before 
my time... I'll check.  
Comment 6 Dan Armak (RETIRED) gentoo-dev 2002-09-07 15:40:15 UTC
Sorry! I was thinking of an entirely different app as it turns out. I only now  
realized what it is we're talking about and that the k in knews doesn't mean 
it's a kde app. I believe Seemant made that mistake too and that's why he 
assigned it to the kde@gentoo.org list. 
 
Seemant, please send this where it belongs (I believe phoenix had something to 
do with it?) 
Comment 7 Seemant Kulleen (RETIRED) gentoo-dev 2002-09-14 23:41:16 UTC
achim,

ok, I have the fix in waiting to be committed, but knews just isn't compiling at
all.  I keep getting libpng errors:

gcc -O2 -Wall   -I../Widgets  -I/usr/include  -I/usr/X11R6/include    -Dlinux
-D__i386__ -D_POSIX_C_SOURCE=199309L -D_POSIX_SOURCE -D_XOPEN_SOURCE
-D_BSD_SOURCE -D_SVID_SOURCE     -DFUNCPROTO=15 -DNARROWPROTO       -c -o png.o
png.c
png.c: In function `do_png':
png.c:111: warning: implicit declaration of function `png_read_init'
png.c:112: invalid lvalue in unary `&'
make[1]: *** [png.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/knews-1.0.1b-r1/work/knews-1.0b.1/src'
make: *** [all] Error 2


what do you make of that?
Comment 8 Achim Linder 2002-09-15 09:48:44 UTC
Either switch it off in configure.h
#define HAVE_PNG        0
(and set HAVE_COMPFACE to 0 if you don't have libcompface)
or get the patch for png.c from the Debian diff
ftp.debian.org/debian/pool/main/k/knews/knews_1.0b.1-9.diff.gz
Works for me (libpng-1.2.x).
Comment 9 Seemant Kulleen (RETIRED) gentoo-dev 2002-09-27 07:09:17 UTC
thanks for this achim.