diff src/noffle.c @ 477:48be71391b9d noffle

[svn] * docs/noffle.1,src/noffle.c: When outputing the entire message base using 'noffle --article all', ditch the previous casual header for each article and switch to the 'rnews' format.
author bears
date Fri, 09 Jul 2004 16:27:20 +0100
parents e63a3bc27a75
children a04c52f87b6e
line wrap: on
line diff
--- a/src/noffle.c	Tue Mar 16 11:44:43 2004 +0000
+++ b/src/noffle.c	Fri Jul 09 16:27:20 2004 +0100
@@ -10,7 +10,7 @@
   received for some seconds (to allow multiple clients connect at the same
   time).
 
-  $Id: noffle.c 621 2003-11-29 23:53:31Z bears $
+  $Id: noffle.c 624 2004-07-09 15:27:20Z bears $
 */
 
 #if HAVE_CONFIG_H
@@ -75,12 +75,17 @@
         else
             do
             {
-                printf( "From %s %s\n"
-                        "%s\n"
-                        "%s\n",
-                        Db_from( id ), Db_date( id ),
-                        Db_header( id ),
-                        Db_body( id ) );
+		/*
+		 * Output articles in rnews format. The number after
+		 * the rnews header is the length of the article in bytes,
+		 * counting line endings as '\n'.
+		 */
+		const char *header = Db_header( id );
+		const char *body = Db_body( id );
+
+		printf( "#! rnews %d\n%s\n%s\n",
+			strlen(header) + strlen(body) + 2,
+			header, body);
 		res = TRUE;
             }
             while ( Db_next( &id ) );