Mercurial > noffle
diff src/configfile.c @ 150:1c7303c71f66 noffle
[svn] * src/protocol.c: Fix bug in Prt_getLn if we should read a line
starting with '\0' - according to the leafnode mailing list,
this has been seen in the wild.
* docs/inews.1,docs/noffle.1,docs/noffle.conf.5,
packages/redhat/noffle.spec,src/configfile.h,src/configfile.c,
src/noffle.c,src/post.h,src/post.c: Removed use of getopt_long,
and added inews mode - the Noffle executable behaves
as inews is invoked as inews. This includes adding From: and
Organization: headers if necessary - add configs to override
defaults for the From: domain and specify the organization.
For all my fellow trn-heads out there, and users of any other
ageing newsreader that expects inews. Updated RPM spec to create
inews link to noffle on install.
author | bears |
---|---|
date | Thu, 26 Oct 2000 22:21:13 +0100 |
parents | 7dfbb1c20a81 |
children | fed1334d766b |
line wrap: on
line diff
--- a/src/configfile.c Thu Oct 26 22:13:28 2000 +0100 +++ b/src/configfile.c Thu Oct 26 22:21:13 2000 +0100 @@ -6,7 +6,7 @@ SPOOLDIR VERSION - $Id: configfile.c 199 2000-08-15 23:08:13Z bears $ + $Id: configfile.c 227 2000-10-26 21:21:13Z bears $ */ #if HAVE_CONFIG_H @@ -92,6 +92,8 @@ int maxAutoSubscribeMode; AutoSubscribeModeEntry *autoSubscribeMode; Str pathHeader; + Str fromDomain; + Str organization; } config = { SPOOLDIR, /* spoolDir */ @@ -118,7 +120,9 @@ 0, /* numAutoSubscribeMode */ 0, /* maxAutoSubscribeMode */ NULL, /* autoSubscribeMode */ - "" /* pathHeader */ + "", /* pathHeader */ + "", /* fromDomain */ + "" /* organization */ }; const char * Cfg_spoolDir( void ) { return config.spoolDir; } @@ -138,6 +142,8 @@ const char * Cfg_mailTo( void ) { return config.mailTo; } int Cfg_defaultExpire( void ) { return config.defaultExpire; } const char * Cfg_pathHeader( void ) { return config.pathHeader; } +const char * Cfg_fromDomain( void ) { return config.fromDomain; } +const char * Cfg_organization( void ) { return config.organization; } void Cfg_beginServEnum( void ) @@ -363,6 +369,16 @@ } static void +getText( Str variable, const char *line ) +{ + const char *l; + + /* Skip command */ + l = Utl_restOfLn( line, 1 ); + Utl_cpyStr( variable, l ); +} + +static void getServ( const char *line ) { Str dummy, name, user, pass; @@ -808,11 +824,15 @@ getGroups( p, TRUE ); else if ( strcmp( "omitgroups", name ) == 0 ) getGroups( p, FALSE ); + else if ( strcmp( "path-header", name ) == 0 ) + getStr( config.pathHeader, p ); + else if ( strcmp( "from-domain", name ) == 0 ) + getStr( config.fromDomain, p ); /* The following need line because they may have uppercase data */ + else if ( strcmp( "organization", name ) == 0 ) + getText( config.organization, line ); else if ( strcmp( "server", name ) == 0 ) getServ( line ); - else if ( strcmp( "path-header", name ) == 0 ) - getStr( config.pathHeader, p ); else if ( strcmp( "filter", name ) == 0 ) getFilter( line ); else