Mercurial > noffle
comparison src/post.c @ 247:7a830ce3211e noffle
[svn] *** empty log message ***
author | mirkol |
---|---|
date | Tue, 26 Mar 2002 17:52:01 +0000 |
parents | fbff73fe5b40 |
children | baa6408d1bbc |
comparison
equal
deleted
inserted
replaced
246:6f3a55d18659 | 247:7a830ce3211e |
---|---|
1 /* | 1 /* |
2 post.c | 2 post.c |
3 | 3 |
4 $Id: post.c 371 2002-02-26 17:13:31Z bears $ | 4 $Id: post.c 379 2002-03-26 17:52:01Z mirkol $ |
5 */ | 5 */ |
6 | 6 |
7 #if HAVE_CONFIG_H | 7 #if HAVE_CONFIG_H |
8 #include <config.h> | 8 #include <config.h> |
9 #endif | 9 #endif |
182 | 182 |
183 s = new_DynStr( 10000 ); | 183 s = new_DynStr( 10000 ); |
184 article.text = s; | 184 article.text = s; |
185 | 185 |
186 replyToFound = pathFound = orgFound = FALSE; | 186 replyToFound = pathFound = orgFound = FALSE; |
187 | 187 |
188 field[ 0 ] = '\0'; | |
189 | |
188 /* Grab header lines first, getting overview info as we go. */ | 190 /* Grab header lines first, getting overview info as we go. */ |
189 while ( ( p = Utl_getHeaderLn( line, p ) ) != NULL | 191 while ( ( p = Utl_getHeaderLn( line, p ) ) != NULL |
190 && line[ 0 ] != '\0' | 192 && line[ 0 ] != '\0' |
191 && Prt_getField( field, value, line ) ) | 193 && Prt_getField( field, value, line ) ) |
192 { | 194 { |
195 if ( field [ 0 ] == '\0' ) | |
196 { | |
197 /* Error! Continuation without preceding header. */ | |
198 Log_err( "First header line started with white space" ); | |
199 return FALSE; | |
200 } | |
193 /* Look for headers we need to stash. */ | 201 /* Look for headers we need to stash. */ |
194 if ( strcmp( field, "subject" ) == 0 ) | 202 if ( strcmp( field, "subject" ) == 0 ) |
195 { | 203 { |
196 Utl_cpyStr( article.over.subject, value ); | 204 Utl_catStr( article.over.subject, value ); |
197 DynStr_appLn( s, line ); | 205 DynStr_appLn( s, line ); |
198 } | 206 } |
199 else if ( strcmp ( field, "from" ) == 0 ) | 207 else if ( strcmp ( field, "from" ) == 0 ) |
200 { | 208 { |
201 Utl_cpyStr( article.over.from, value ); | 209 Utl_catStr( article.over.from, value ); |
202 DynStr_appLn( s, line ); | 210 DynStr_appLn( s, line ); |
203 } | 211 } |
204 else if ( strcmp ( field, "date" ) == 0 ) | 212 else if ( strcmp ( field, "date" ) == 0 ) |
205 Utl_cpyStr( article.over.date, value ); | 213 Utl_catStr( article.over.date, value ); |
206 else if ( strcmp ( field, "references" ) == 0 ) | 214 else if ( strcmp ( field, "references" ) == 0 ) |
207 { | 215 { |
208 Utl_cpyStr( article.over.ref, value ); | 216 Utl_catStr( article.over.ref, value ); |
209 DynStr_appLn( s, line ); | 217 DynStr_appLn( s, line ); |
210 } | 218 } |
211 else if ( strcmp ( field, "message-id" ) == 0 ) | 219 else if ( strcmp ( field, "message-id" ) == 0 ) |
220 /* Utl_catStr( article.over.msgId, value ); */ | |
212 Utl_cpyStr( article.over.msgId, value ); | 221 Utl_cpyStr( article.over.msgId, value ); |
213 else if ( strcmp ( field, "newsgroups" ) == 0 ) | 222 else if ( strcmp ( field, "newsgroups" ) == 0 ) |
214 { | 223 { |
215 article.newsgroups = new_Itl( value, " ,\n\t" ); | 224 article.newsgroups = new_Itl( value, " ,\n\t" ); |
216 DynStr_appLn( s, line ); | 225 DynStr_appLn( s, line ); |