From: markus schnalke Date: Tue, 27 Mar 2012 10:33:35 +0000 (+0200) Subject: new: Improve the fix with the NULL-sentinel. X-Git-Tag: mmh-thesis-end~145 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=0dc43cbf916830e524ee705664bc9d1e1addaee2;p=mmh new: Improve the fix with the NULL-sentinel. With multiple sequence arguments on the command line you might end up with garbage in the sequence[] array (it needs the last argument to be a NULL. So do two things: make the first two arguments NULL, and as we add arguments to sequence[] make sure the list has a NULL on the end. This is another problem discovered by the nmh test suite. Pulled in from nmh. Thanks to Ken Hornstein. --- diff --git a/uip/new.c b/uip/new.c index f6ac364..dab17ad 100644 --- a/uip/new.c +++ b/uip/new.c @@ -433,6 +433,7 @@ main(int argc, char **argv) struct node *folder; sequences[0] = NULL; + sequences[1] = NULL; #ifdef LOCALE setlocale(LC_ALL, ""); @@ -483,6 +484,7 @@ main(int argc, char **argv) /* have a sequence argument */ if (!seq_in_list(cp, sequences)) { sequences[i++] = cp; + sequences[i] = NULL; } }