changeset 230:c3478c3c81ce noffle

[svn] see ChangeLog Wed Dec 19 2001
author mirkol
date Wed, 19 Dec 2001 16:06:30 +0000
parents 5de86280496f
children e7ee1bb9887b
files src/over.c
diffstat 1 files changed, 24 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/over.c	Tue Dec 18 19:18:47 2001 +0000
+++ b/src/over.c	Wed Dec 19 16:06:30 2001 +0000
@@ -1,7 +1,7 @@
 /*
   over.c
 
-  $Id: over.c 316 2001-10-31 11:44:53Z bears $
+  $Id: over.c 360 2001-12-19 16:06:30Z mirkol $
 */
 
 #if HAVE_CONFIG_H
@@ -44,6 +44,24 @@
     time_t time;
 };
 
+static void
+replacetabs_Over( const char *header )
+/* Replace the tab character in overview data by a space.
+   refer to rfc2980 */
+{
+    while( *header )
+        switch ( *header )
+        {
+            case '\t':
+            case '\r':
+            case '\n':
+                *header = ' ';
+            default:
+                header++;
+        }
+    return;
+}
+
 Over *
 new_Over( const char *subj, const char *from,
           const char *date, const char *msgId, const char *ref,
@@ -142,6 +160,11 @@
 Bool
 Ov_write( const Over *self, FILE *f )
 {
+    replacetabs_Over( self->subj );
+    replacetabs_Over( self->from );
+    replacetabs_Over( self->date );
+    replacetabs_Over( self->msgId );
+    replacetabs_Over( self->ref );
     return ( fprintf( f, "%i\t%s\t%s\t%s\t%s\t%s\t%d\t%d\n",
                       self->numb, self->subj,
                       self->from, self->date, self->msgId,