=== modified file 'nih/option.c' --- nih/option.c 2009-11-21 21:46:40 +0000 +++ nih/option.c 2012-08-14 14:51:34 +0000 @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -209,7 +210,9 @@ char *arg; arg = ctx.argv[ctx.arg]; - if ((arg[0] != '-') || (arg[1] == '\0') + if ((arg[0] != '-') + || (arg[0] == '-' && arg[1] && isdigit (arg[1])) + || (arg[1] == '\0') || (ctx.optend && ctx.arg > ctx.optend)) { /* Not an option */ if (ctx.arg > ctx.nonopt) { @@ -542,6 +545,7 @@ arg = ctx->argv[ctx->nonopt]; if ((arg[0] != '-') + || (arg[0] == '-' && isdigit (arg[1])) || (ctx->optend && ctx->nonopt > ctx->optend)) { return arg;