diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-01 13:20:38 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-01-01 13:20:38 +0000 |
commit | 78a4b29f991e8b77a145ee53064c23efc539dd5d (patch) | |
tree | 8fdd3575a38bf5835e469617925ad418e22c65da | |
parent | 38b2729bc2c5ed252afdea49c5cda45a80a57f6e (diff) | |
download | mandoc-78a4b29f991e8b77a145ee53064c23efc539dd5d.tar.gz |
If man(1) only has one single argument, always interpret it as a name,
never as a section. Who would have thought that people call their
manual pages 7z(1), 9c(1), 9p(1), and 9p(3)...
Patch from Sebastien Marie <semarie dash openbsd at latrappe dot fr>.
-rw-r--r-- | main.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -310,7 +310,8 @@ main(int argc, char *argv[]) argv = help_argv; argc = 1; } - } else if (((uc = argv[0]) != NULL) && + } else if (argc > 1 && + ((uc = argv[0]) != NULL) && ((isdigit(uc[0]) && (uc[1] == '\0' || (isalpha(uc[1]) && uc[2] == '\0'))) || (uc[0] == 'n' && uc[1] == '\0'))) { |