[news.software.b] white space in NEWSCTL/sys

sjg@melb.bull.oz.au (Simon J. Gerraty) (01/24/91)

Yesterday, after updating an entry in NEWSCTL/sys
our News software (relaynews) went berserk.

The error message involved was:

relaynews: whitespace in system name (or exclusions) of sys entry for ` ' 

Self explanitary I know.  But it took me ages to twig that the
problem was a space on a line by itself (at the end of the sys
file).  I was looking for problems _in_ the sys file entries.

It seems to me that white-space can creep into a file like this
too easily for relaynews not to cope with the situation.  So I
thought the following patch might be a good idea.  I have not
yet installed this myself BTW.  Anyone know what it might break?

*** sys.c.orig	Thu Jan 24 08:17:08 1991
--- sys.c	Thu Jan 24 10:21:15 1991
***************
*** 126,131 ****
--- 126,140 ----
  	register struct system *sysp =(struct system *)nemalloc(sizeof *sysp);
  	char *flagstring;
  
+ 	/*
+ 	 * 91-01-23 <sjg@melb.bull.oz.au>
+ 	 * A line containing only a '\t' or ' ' in NEWSCTL/sys
+ 	 * has very undesirable results.
+ 	 */
+ 	while (*sysline && (*sysline == ' ' || *sysline == '\t'))
+ 	  sysline++;
+ 	if (*sysline == '#' || *sysline == '\n')
+ 	  return ;
  	trim(sysline);
  	next = sysline;
  	parse(&sysp->sy_name);
-- 
Simon J. Gerraty			<sjg@sun0.melb.bull.oz.au>

#include <disclaimer>             /* imagine something *very* witty here */