From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost (fantadrom.bsd.lv [local]); by fantadrom.bsd.lv (OpenSMTPD) with ESMTPA id b90ae548; for ; Wed, 17 Dec 2014 13:45:35 -0500 (EST) Date: Wed, 17 Dec 2014 13:45:35 -0500 (EST) Message-Id: <11736869099576701345.enqueue@fantadrom.bsd.lv> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: schwarze@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Be a bit more lenient in what to accept for section names given X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Be a bit more lenient in what to accept for section names given as the first man(1) command line argument without -s: Accept digits like "1", "2"; digit+letter like "3p", "1X"; and "n". Issue reported by Svyatoslav Mishyn (Crux Linux). Modified Files: -------------- mdocml: main.c Revision Data ------------- Index: main.c =================================================================== RCS file: /home/cvs/mdocml/mdocml/main.c,v retrieving revision 1.206 retrieving revision 1.207 diff -Lmain.c -Lmain.c -u -p -r1.206 -r1.207 --- main.c +++ main.c @@ -114,6 +114,7 @@ main(int argc, char *argv[]) struct manpaths paths; char *auxpaths; char *defos; + unsigned char *uc; #if HAVE_SQLITE3 struct manpage *res, *resp; char *conf_file, *defpaths; @@ -309,11 +310,11 @@ main(int argc, char *argv[]) argv = help_argv; argc = 1; } - } else if (argv[0] != NULL && ( - (isdigit((unsigned char)argv[0][0]) && - (argv[0][1] == '\0' || !strcmp(argv[0], "3p"))) || - (argv[0][0] == 'n' && argv[0][1] == '\0'))) { - search.sec = argv[0]; + } else if (((uc = argv[0]) != NULL) && + ((isdigit(uc[0]) && (uc[1] == '\0' || + (isalpha(uc[1]) && uc[2] == '\0'))) || + (uc[0] == 'n' && uc[1] == '\0'))) { + search.sec = uc; argv++; argc--; } -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv