tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: tech@mdocml.bsd.lv
Subject: Re: implement .so
Date: Wed, 27 Oct 2010 01:10:56 +0200	[thread overview]
Message-ID: <20101026231056.GJ27536@iris.usta.de> (raw)
In-Reply-To: <20101026181252.GA4964@britannica.bec.de>

Hi Joerg,

Joerg Sonnenberger wrote on Tue, Oct 26, 2010 at 08:12:52PM +0200:

> I would like to a see a warning for -T lint, but I am not sure how that
> could be implemented easily.

Is this what you hoped for?

ischwarze@isnote $ mandoc -Tlint /usr/X11R6/man/man3/XevieStart.3 
/usr/X11R6/man/man3/XevieStart.3:1:1: WARNING: .so is fragile, better use ln(1)
man3/Xevie.3: No such file or directory
ischwarze@isnote $ cd /usr/X11R6/man/
ischwarze@isnote $ mandoc -Tlint man3/XevieStart.3
man3/XevieStart.3:1:1: WARNING: .so is fragile, better use ln(1)
man3/Xevie.3:10:13: WARNING: cannot parse date argument
man3/Xevie.3:16:7: WARNING: end of line whitespace
man3/Xevie.3:45:43: WARNING: end of line whitespace

Yours,
  Ingo


Index: main.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/main.c,v
retrieving revision 1.53
diff -u -p -r1.53 main.c
--- main.c	26 Oct 2010 22:48:07 -0000	1.53
+++ main.c	26 Oct 2010 23:08:59 -0000
@@ -115,6 +115,7 @@ static	const char * const	mandocerrs[MAN
 	"macro not allowed in body",
 
 	/* related to document structure */
+	".so is fragile, better use ln(1)",
 	"NAME section must come first",
 	"bad NAME section contents",
 	"manual name not yet set",
Index: mandoc.h
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/mandoc.h,v
retrieving revision 1.19
diff -u -p -r1.19 mandoc.h
--- mandoc.h	26 Oct 2010 22:48:07 -0000	1.19
+++ mandoc.h	26 Oct 2010 23:08:59 -0000
@@ -57,6 +57,7 @@ enum	mandocerr {
 	MANDOCERR_BADBODY, /* macro not allowed in body */
 
 	/* related to document structure */
+	MANDOCERR_SO, /* .so is fragile, better use ln(1) */
 	MANDOCERR_NAMESECFIRST, /* NAME section must come first */
 	MANDOCERR_BADNAMESEC, /* bad NAME section contents */
 	MANDOCERR_NONAME, /* manual name not yet set */
Index: roff.c
===================================================================
RCS file: /cvs/src/usr.bin/mandoc/roff.c,v
retrieving revision 1.14
diff -u -p -r1.14 roff.c
--- roff.c	26 Oct 2010 22:28:57 -0000	1.14
+++ roff.c	26 Oct 2010 23:08:59 -0000
@@ -1017,6 +1017,8 @@ roff_so(ROFF_ARGS)
 {
 	char *name;
 
+	(*r->msg)(MANDOCERR_SO, r->data, ln, ppos, NULL);
+
 	name = *bufp + pos;
 	if ('/' == *name || strstr(name, "../") || strstr(name, "/..")) {
 		(*r->msg)(MANDOCERR_SOPATH, r->data, ln, pos, NULL);
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  parent reply	other threads:[~2010-10-26 23:11 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24 16:40 Ingo Schwarze
2010-10-24 16:49 ` Joerg Sonnenberger
2010-10-24 17:29   ` Ingo Schwarze
2010-10-24 17:38     ` Joerg Sonnenberger
2010-10-24 18:00       ` Ingo Schwarze
2010-10-24 18:15         ` Joerg Sonnenberger
2010-10-24 18:17           ` Joerg Sonnenberger
2010-10-24 19:41           ` Ingo Schwarze
2010-10-24 19:51             ` Joerg Sonnenberger
2010-10-25 21:55               ` Ingo Schwarze
2010-10-25 22:10                 ` Joerg Sonnenberger
2010-10-26 17:59                   ` Ingo Schwarze
2010-10-26 18:12                     ` Joerg Sonnenberger
2010-10-26 21:48                       ` Ingo Schwarze
2010-10-26 21:56                         ` Joerg Sonnenberger
2010-10-26 23:10                       ` Ingo Schwarze [this message]
2010-10-26 23:30                         ` Joerg Sonnenberger
2010-10-26 23:41                           ` Ingo Schwarze
2010-10-27  9:34                             ` Kristaps Dzonsons

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=20101026231056.GJ27536@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=tech@mdocml.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).