From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: mandoc: Make sure that -l always causes -w to be ignored, as documented
Date: Thu, 6 Feb 2020 14:42:10 -0500 (EST) [thread overview]
Message-ID: <ecf57dc576fa4050@mandoc.bsd.lv> (raw)
Log Message:
-----------
Make sure that -l always causes -w to be ignored, as documented
in the man(1) manual page. This bugfix is needed to prevent
the command "man -lw" from dereferencing a NULL pointer.
Modified Files:
--------------
mandoc:
main.c
Revision Data
-------------
Index: main.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/main.c,v
retrieving revision 1.341
retrieving revision 1.342
diff -Lmain.c -Lmain.c -u -p -r1.341 -r1.342
--- main.c
+++ main.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2012, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -326,7 +326,8 @@ main(int argc, char *argv[])
/* Postprocess options. */
- if (outmode == OUTMODE_DEF) {
+ switch (outmode) {
+ case OUTMODE_DEF:
switch (search.argmode) {
case ARG_FILE:
outmode = OUTMODE_ALL;
@@ -339,6 +340,16 @@ main(int argc, char *argv[])
outmode = OUTMODE_LST;
break;
}
+ break;
+ case OUTMODE_FLN:
+ if (search.argmode == ARG_FILE)
+ outmode = OUTMODE_ALL;
+ break;
+ case OUTMODE_ALL:
+ break;
+ case OUTMODE_LST:
+ case OUTMODE_ONE:
+ abort();
}
if (oarg != NULL) {
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
reply other threads:[~2020-02-06 19:42 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ecf57dc576fa4050@mandoc.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).