CVS commit: [netbsd-7] src/usr.sbin/makemandb

2016-04-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Apr 15 07:47:30 UTC 2016

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: apropos-utils.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1142):
usr.sbin/makemandb/apropos-utils.c: revisions 1.18, 1.19
CID 1341551: Don't bother formatting if ti == NULL
--
PR/50344: Stephen Fisher: apropos shows formatting on console with vt100 term
type. Can't print terminfo sequences directly; need to process them with
ti_puts() to handle padding. This removes the padding delays, and stricly
could break on slow terminal hardware, but they way the code is structured
makes it impossible to fix properly (since the formatting strings are
passed in the query).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.2.1 src/usr.sbin/makemandb/apropos-utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2016-04-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Fri Apr 15 07:47:30 UTC 2016

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: apropos-utils.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1142):
usr.sbin/makemandb/apropos-utils.c: revisions 1.18, 1.19
CID 1341551: Don't bother formatting if ti == NULL
--
PR/50344: Stephen Fisher: apropos shows formatting on console with vt100 term
type. Can't print terminfo sequences directly; need to process them with
ti_puts() to handle padding. This removes the padding delays, and stricly
could break on slow terminal hardware, but they way the code is structured
makes it impossible to fix properly (since the formatting strings are
passed in the query).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.2.1 src/usr.sbin/makemandb/apropos-utils.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/apropos-utils.c
diff -u src/usr.sbin/makemandb/apropos-utils.c:1.16 src/usr.sbin/makemandb/apropos-utils.c:1.16.2.1
--- src/usr.sbin/makemandb/apropos-utils.c:1.16	Fri Aug  1 12:55:00 2014
+++ src/usr.sbin/makemandb/apropos-utils.c	Fri Apr 15 07:47:29 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: apropos-utils.c,v 1.16 2014/08/01 12:55:00 wiz Exp $	*/
+/*	$NetBSD: apropos-utils.c,v 1.16.2.1 2016/04/15 07:47:29 snj Exp $	*/
 /*-
  * Copyright (c) 2011 Abhinav Upadhyay 
  * All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: apropos-utils.c,v 1.16 2014/08/01 12:55:00 wiz Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.16.2.1 2016/04/15 07:47:29 snj Exp $");
 
 #include 
 #include 
@@ -891,6 +891,36 @@ run_query_pager(sqlite3 *db, query_args 
 	return run_query_internal(db, snippet_args, args);
 }
 
+struct nv {
+	char *s;
+	size_t l;
+};
+
+static int
+term_putc(int c, void *p)
+{
+	struct nv *nv = p;
+	nv->s[nv->l++] = c;
+	return 0;
+}
+
+static char *
+term_fix_seq(TERMINAL *ti, const char *seq)
+{
+	char *res = estrdup(seq);
+	struct nv nv;
+
+	if (ti == NULL)
+	return res;
+
+	nv.s = res;
+	nv.l = 0;
+	ti_puts(ti, seq, 1, term_putc, );
+	nv.s[nv.l] = '\0';
+
+	return res;
+}
+
 static void
 term_init(int fd, const char *sa[5])
 {
@@ -920,11 +950,12 @@ term_init(int fd, const char *sa[5])
 			smul = rmul = "";
 	}
 
-	sa[0] = estrdup(bold ? bold : smso);
-	sa[1] = estrdup(sgr0 ? sgr0 : rmso);
+	sa[0] = term_fix_seq(ti, bold ? bold : smso);
+	sa[1] = term_fix_seq(ti, sgr0 ? sgr0 : rmso);
 	sa[2] = estrdup("...");
-	sa[3] = estrdup(smul);
-	sa[4] = estrdup(rmul);
+	sa[3] = term_fix_seq(ti, smul);
+	sa[4] = term_fix_seq(ti, rmul);
+
 	if (ti)
 		del_curterm(ti);
 }



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:26:04 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #675):
usr.sbin/makemandb/makemandb.c: revision 1.27
- handle section numbers that are not single digits
- don't allocate and free needlessly


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.2 -r1.24.2.3 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-04-13 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Tue Apr 14 04:26:04 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #675):
usr.sbin/makemandb/makemandb.c: revision 1.27
- handle section numbers that are not single digits
- don't allocate and free needlessly


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.2 -r1.24.2.3 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.24.2.2 src/usr.sbin/makemandb/makemandb.c:1.24.2.3
--- src/usr.sbin/makemandb/makemandb.c:1.24.2.2	Sun Mar 15 22:44:28 2015
+++ src/usr.sbin/makemandb/makemandb.c	Tue Apr 14 04:26:04 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.24.2.3 2015/04/14 04:26:04 snj Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.24.2.3 2015/04/14 04:26:04 snj Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -990,12 +990,11 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 			 * An Xr macro was seen previously, so parse this
 			 * and the next node.
 			 */
-			temp = estrdup(n-string);
+			temp = n-string;
 			n = n-next;
 			easprintf(buf, %s(%s), temp, n-string);
 			concat(rec-name_desc, buf);
 			free(buf);
-			free(temp);
 		} else {
 			nd_text = estrdup(n-string);
 			replace_hyph(nd_text);
@@ -1052,13 +1051,8 @@ pmdoc_macro_handler(const struct mdoc_no
 			n = n-next;
 
 		if (n  n-type == MDOC_TEXT) {
-			size_t len = strlen(sn-string);
-			char *buf = emalloc(len + 4);
-			memcpy(buf, sn-string, len);
-			buf[len] = '(';
-			buf[len + 1] = n-string[0];
-			buf[len + 2] = ')';
-			buf[len + 3] = 0;
+			char *buf;
+			easprintf(buf, %s(%s), sn-string, n-string);
 			mdoc_parse_section(n-sec, buf, rec);
 			free(buf);
 		}



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-03-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 15 22:44:28 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #589):
usr.sbin/makemandb/makemandb.c: revision 1.28
MDOC_MAX is a valid token if the type is text. Adjust.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.24.2.1 src/usr.sbin/makemandb/makemandb.c:1.24.2.2
--- src/usr.sbin/makemandb/makemandb.c:1.24.2.1	Sat Mar  7 06:21:08 2015
+++ src/usr.sbin/makemandb/makemandb.c	Sun Mar 15 22:44:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.24.2.1 2015/03/07 06:21:08 snj Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.24.2.1 2015/03/07 06:21:08 snj Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.24.2.2 2015/03/15 22:44:28 snj Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -981,7 +981,7 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 	char *temp;
 	char *nd_text;
 
-	if (n == NULL || n-tok == MDOC_MAX)
+	if (n == NULL || (n-type != MDOC_TEXT  n-tok == MDOC_MAX))
 		return;
 
 	if (n-type == MDOC_TEXT) {
@@ -1104,7 +1104,7 @@ pmdoc_Pp(const struct mdoc_node *n, mand
 static void
 pmdoc_Sh(const struct mdoc_node *n, mandb_rec *rec)
 {
-	if (n == NULL || n-tok == MDOC_MAX)
+	if (n == NULL || (n-type != MDOC_TEXT  n-tok == MDOC_MAX))
 		return;
 	int xr_found = 0;
 



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-03-15 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sun Mar 15 22:44:28 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #589):
usr.sbin/makemandb/makemandb.c: revision 1.28
MDOC_MAX is a valid token if the type is text. Adjust.


To generate a diff of this commit:
cvs rdiff -u -r1.24.2.1 -r1.24.2.2 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-03-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Mar  7 06:21:08 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by he in ticket #563):
crypto/external/bsd/openssh/Makefile.inc: revision 1.8
Sync the HAVE's with reality


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/makemandb.c
diff -u src/usr.sbin/makemandb/makemandb.c:1.24 src/usr.sbin/makemandb/makemandb.c:1.24.2.1
--- src/usr.sbin/makemandb/makemandb.c:1.24	Tue Jun  3 14:42:41 2014
+++ src/usr.sbin/makemandb/makemandb.c	Sat Mar  7 06:21:08 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: makemandb.c,v 1.24 2014/06/03 14:42:41 wiz Exp $	*/
+/*	$NetBSD: makemandb.c,v 1.24.2.1 2015/03/07 06:21:08 snj Exp $	*/
 /*
  * Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
  * Copyright (c) 2011 Kristaps Dzonsons krist...@bsd.lv
@@ -17,7 +17,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: makemandb.c,v 1.24 2014/06/03 14:42:41 wiz Exp $);
+__RCSID($NetBSD: makemandb.c,v 1.24.2.1 2015/03/07 06:21:08 snj Exp $);
 
 #include sys/stat.h
 #include sys/types.h
@@ -981,7 +981,7 @@ pmdoc_Nd(const struct mdoc_node *n, mand
 	char *temp;
 	char *nd_text;
 
-	if (n == NULL)
+	if (n == NULL || n-tok == MDOC_MAX)
 		return;
 
 	if (n-type == MDOC_TEXT) {
@@ -1104,7 +1104,7 @@ pmdoc_Pp(const struct mdoc_node *n, mand
 static void
 pmdoc_Sh(const struct mdoc_node *n, mandb_rec *rec)
 {
-	if (n == NULL)
+	if (n == NULL || n-tok == MDOC_MAX)
 		return;
 	int xr_found = 0;
 



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2015-03-06 Thread Soren Jacobsen
Module Name:src
Committed By:   snj
Date:   Sat Mar  7 06:21:08 UTC 2015

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: makemandb.c

Log Message:
Pull up following revision(s) (requested by he in ticket #563):
crypto/external/bsd/openssh/Makefile.inc: revision 1.8
Sync the HAVE's with reality


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.2.1 src/usr.sbin/makemandb/makemandb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2014-11-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  7 08:38:50 UTC 2014

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: apropos.1

Log Message:
Pull up following revision(s) (requested by snj in ticket #185):
usr.sbin/makemandb/apropos.1: revision 1.15
Thankfully, apropos returns all results by default these days.  Remove
outdated sentence referring to the original (well, old new) limit of 10.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/usr.sbin/makemandb/apropos.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makemandb/apropos.1
diff -u src/usr.sbin/makemandb/apropos.1:1.14 src/usr.sbin/makemandb/apropos.1:1.14.4.1
--- src/usr.sbin/makemandb/apropos.1:1.14	Fri Nov 29 23:58:23 2013
+++ src/usr.sbin/makemandb/apropos.1	Fri Nov  7 08:38:50 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: apropos.1,v 1.14 2013/11/29 23:58:23 wiz Exp $
+.\ $NetBSD: apropos.1,v 1.14.4.1 2014/11/07 08:38:50 martin Exp $
 .\
 .\ Copyright (c) 2011 Abhinav Upadhyay er.abhinav.upadh...@gmail.com
 .\ All rights reserved.
@@ -57,9 +57,6 @@ utility is more sophisticated than the c
 Like modern search applications, it uses advanced techniques like stemming
 and term weighting to rank the matching results in decreasing order of
 relevance.
-By default
-.Nm
-will only display the top 10 matches in the output.
 .Pp
 Quotes are optional for specifying multiword queries.
 .Pp



CVS commit: [netbsd-7] src/usr.sbin/makemandb

2014-11-07 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Nov  7 08:38:50 UTC 2014

Modified Files:
src/usr.sbin/makemandb [netbsd-7]: apropos.1

Log Message:
Pull up following revision(s) (requested by snj in ticket #185):
usr.sbin/makemandb/apropos.1: revision 1.15
Thankfully, apropos returns all results by default these days.  Remove
outdated sentence referring to the original (well, old new) limit of 10.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.4.1 src/usr.sbin/makemandb/apropos.1

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.