Great Circle Associates Majordomo-Workers
(November 1996)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: Bug & patch: writeconfig chops lines at 80 chars
From: Dave Wolfe <dwolfe @ risc . sps . mot . com>
Date: Tue, 19 Nov 1996 08:56:34 -0600 (CST)
To: amillar @ bolis . com (Alan Millar)
Cc: majordomo-workers @ GreatCircle . COM, tibbs @ hpc . uh . edu
In-reply-to: <m0vOv4y-000G0KC@hock.bolis.com> from "Alan Millar" at Nov 16, 96 04:27:20 pm
Reply-to: Dave Wolfe <david_wolfe @ risc . sps . mot . com>

[ Alan Millar writes: ]
> 
> I have found that writeconfig chops off config file lines at 80 
> characters.
[...]
> Anyways, here is my patch.  I tried it and it doesn't break anything 
> as far as I can tell :-)
> 
> =============================================================
> =============================================================
> --- config_parse.pl.orig	Sat Nov 16 15:44:00 1996
> +++ config_parse.pl	Sat Nov 16 16:12:00 1996
> @@ -515,12 +515,12 @@
>      format OUT =
>  	@<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>       $key,           $intro
>  	^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ~~
>       $comment
> -@<<<<<<<<<<<<<<<<<< @<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> -$key,		 $op, $value
> +	@<<<<<<<<<<<<<<<<<< @<< @*
> +     $key,		 $op, $value

Some questions: why did you indent the keywords? Being at the left edge
is what made them stand out. Long line wrap is totally dependent on
external factors, such as viewer window width, font size, etc.

>  .
>      
>      &main'open_temp(OUT, "$listdir/$list.config.out") 
>        || &main'abort("Can't create new config file $listdir/$list.config.out");
>  
> @@ -586,13 +586,16 @@
>  	print OUT $lval, "\nEND\n" 
>  	    || &main'abort("Error writing config file for $list, $!");
>  	
>  	$op = '=';
>      } else { 
> +	if (! $value ) { $value=" "; } 

You might note that this is necessary for Perl 4. Strictly a style
issue, but I prefer the clearer:

	$value = " " unless $value;	# Necessary for Perl 4

>  	write(OUT)
>  	    || &main'abort("Error writing config file for $list, $!");
>      }
> +    print OUT "\n"
> +	    || &main'abort("Error writing config file for $list, $!");

What is the extra newline for? Write to a @* format terminates the
line correctly (with a newline). If it's to restore spacing between
variables, that's better done in the format (which I've already
submitted patches for) where it doesn't require yet another abort
message and test.

-- 
 Dave Wolfe


References:
Indexed By Date Previous: Re: another bug fix to 1.94 majordomo.pl
From: Dave Wolfe <dwolfe@risc.sps.mot.com>
Next: Re: Statistics about the number of times a list is used
From: Dave Wolfe <dwolfe@risc.sps.mot.com>
Indexed By Thread Previous: Bug & patch: writeconfig chops lines at 80 chars
From: "Alan Millar" <amillar@bolis.com>
Next: Re: Bug & patch: writeconfig chops lines at 80 chars (revisited)
From: Dave Wolfe <dwolfe@risc.sps.mot.com>

Google
 
Search Internet Search www.greatcircle.com