Patch to ignore empty lines in files under /control/
Since empty lines in some of the files in the control dir can result in suprising behaviour I have made a small patch that makes mlmmj ignore those.
As far as I can see empty lines doesn't make any sense in any of the existing tunables, so it should be safe to ignore them.
Unless there are any protests I will probably commit this change sometime tomorrow.
Index: src/ctrlvalues.c
=================================RCS file: /home/mmj/MMJCVS/mlmmj/src/ctrlvalues.c,v retrieving revision 1.2
ctrlvalues.c +2 -0
@@ -52,6 +52,8 @@ ret->strs =NULL ;while ((value =mygetline (ctrlfd)) !=NULL ) {chomp (value); +if (*value ='\0' ) +continue ; ret->count++; ret->strs = (char **)myrealloc (ret->strs,sizeof (char *) * (ret->count +1 ));
Signature · 1 line
Christian Laursen
Quoted 2 lines · Christian Laursen
Unless there are any protests I will probably commit this change sometime tomorrow.
What about the footer file? ;)
Regards,
Quoted 5 lines · Sven 'Darkman' Michels
Quoted 2 lines · Christian Laursen
Unless there are any protests I will probably commit this change sometime tomorrow.
What about the footer file? ;)
As far as I can tell the footer file isn't read by ctrlvalues() so it should remain unaffected.
Signature · 1 line
Christian Laursen
Quoted 9 lines · Christian Laursen
Quoted 5 lines · Sven 'Darkman' Michels
Quoted 2 lines · Christian Laursen
Unless there are any protests I will probably commit this change sometime tomorrow.
What about the footer file? ;)
As far as I can tell the footer file isn't read by
ctrlvalues()so it should remain unaffected.
True. The footer is added with a call to dumpfd2fd().
I think the patch is fine. You might want to add a comment like /* ignore empty lines */ or something :)
Morten
Signature · 2 lines
Morten K. Poulsen <[email protected]> http://www.afdelingp.dk/