[ 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:
|
|