Great Circle Associates Majordomo-Workers
(November 1996)
 

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

Subject: Bug & patch: writeconfig chops lines at 80 chars
From: "Alan Millar" <amillar @ bolis . com>
Organization: The Bolis Group
Date: Sat, 16 Nov 1996 16:27:20 -800
To: majordomo-workers @ GreatCircle . COM
Cc: Jason L Tibbitts III <tibbs @ hpc . uh . edu>
Comments: Authenticated sender is <amillar@bolis.com>

I have found that writeconfig chops off config file lines at 80 
characters.  Note that newconfig happily accepts longer than 80 
character lines and keeps them intact.  But if you re-write the 
config file with writeconfig, it will chop those lines down to 80 
characters.

I discovered this problem on a rather long restrict_post line.  (I 
must say I like the new "MAJORDOMO ABORT ()" messages; quite 
helpful!)  

I have a few lists that are allowed to cross-post.  The first time I
got a majordomo abort message complaining about a restrict_post
filename that was obviously missing the last character, I figured I
must have typed it wrong.  By the second list, I knew something else
was wrong.

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
 .
     
     &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=" "; } 
 	write(OUT)
 	    || &main'abort("Error writing config file for $list, $!");
     }
+    print OUT "\n"
+	    || &main'abort("Error writing config file for $list, $!");
 }
 
 $installing_defaults = 0;
 
 close(OUT);

=============================================================
=============================================================

With this patch, as far as I can tell, there is no specific length 
limit.  (I didn't want to just add a few more <<<<s and have it break 
later.)  If someone has a better method, feel free to suggest it.

Thanks!!

- Alan
----
Alan Millar                  amillar@bolis.com
Owner, System Admin          http://www.bolis.com
Ask me about Internet mailing list services at Bolis.com
Is this a rhetorical question, or what?




Follow-Ups:
Indexed By Date Previous: What is the deal with .passwd?
From: "Alan Millar" <amillar@bolis.com>
Next: Re: What is the deal with .passwd?
From: "Roger B.A. Klorese" <rogerk@QueerNet.ORG>
Indexed By Thread Previous: Re: What is the deal with .passwd?
From: Chan Wilson <cwilson@slurp.neu.sgi.com>
Next: Re: Bug & patch: writeconfig chops lines at 80 chars
From: Dave Wolfe <dwolfe@risc.sps.mot.com>

Google
 
Search Internet Search www.greatcircle.com