Make the horrible inline options parsing for mkd2html a teeny bit more

robust by not bothering to look for options unless there are at least
two arguments left in argv[]
This commit is contained in:
david parsons
2017-01-22 00:15:41 -08:00
parent 2ebcb044d2
commit ed64333f38
+5 -1
View File
@@ -81,7 +81,11 @@ char **argv;
CREATE(footers);
pgm = basename(argv[0]);
while ( argc > 1 ) {
/* the only options we have for this program are -name value pairs,
* so don't even bother parsing them if there aren't still a couple
* of arguments waiting on the line.
*/
while ( argc > 2 ) {
if ( strcmp(argv[1], "-css") == 0 ) {
EXPAND(css) = argv[2];
argc -= 2;