Jivin Mike Frysinger lays it down ... > The current code misses checking a few args in order to determine the > default "print" mode (ktrace/l1stack/...). Rather than update a list > that people easily forget, rework the code to generically detect that > no arguments have been specified.
Applied, Thanks, Davidm > > Signed-off-by: Mike Frysinger <vap...@gentoo.org> > --- > flthdr.c | 8 +++++--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/flthdr.c b/flthdr.c > index 0485107..dfc9107 100644 > --- a/flthdr.c > +++ b/flthdr.c > @@ -326,11 +326,12 @@ usage(char *s) > int > main(int argc, char *argv[]) > { > - int c; > + int c, noargs; > char *ofile = NULL, *ifile; > > elf2flt_progname = argv[0]; > > + noargs = 1; > while ((c = getopt(argc, argv, "pPdzZrRuUkKs:o:")) != EOF) { > switch (c) { > case 'p': print = 1; break; > @@ -353,6 +354,7 @@ main(int argc, char *argv[]) > usage("invalid option"); > break; > } > + noargs = 0; > } > > if (optind >= argc) > @@ -361,9 +363,9 @@ main(int argc, char *argv[]) > if (ofile && argc - optind > 1) > usage("-o can only be used with a single file"); > > - if (!print && !docompress && !ramload && !stacksize) /* no args == > print */ > + if (!print && noargs) /* no args == print */ > print = argc - optind; /* greater than 1 is short format */ > - > + > for (c = optind; c < argc; c++) { > ifile = argv[c]; > if (!ofile) > -- > 1.7.1 > > _______________________________________________ > uClinux-dev mailing list > uClinux-dev@uclinux.org > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev > This message was resent by uclinux-dev@uclinux.org > To unsubscribe see: > http://mailman.uclinux.org/mailman/options/uclinux-dev > > -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev