Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makemandb Handle pages with slashes in their names ...
details: https://anonhg.NetBSD.org/src/rev/e75840218e29
branches: trunk
changeset: 778835:e75840218e29
user: wiz <wiz%NetBSD.org@localhost>
date: Sun Apr 15 15:56:52 2012 +0000
description:
Handle pages with slashes in their names better.
>From Abhinav Upadhyay in private mail.
diffstat:
usr.sbin/makemandb/apropos-utils.c | 11 ++++++++---
usr.sbin/makemandb/apropos.c | 6 +++---
2 files changed, 11 insertions(+), 6 deletions(-)
diffs (72 lines):
diff -r 30085259a76f -r e75840218e29 usr.sbin/makemandb/apropos-utils.c
--- a/usr.sbin/makemandb/apropos-utils.c Sun Apr 15 15:35:00 2012 +0000
+++ b/usr.sbin/makemandb/apropos-utils.c Sun Apr 15 15:56:52 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos-utils.c,v 1.3 2012/04/07 10:44:58 apb Exp $ */
+/* $NetBSD: apropos-utils.c,v 1.4 2012/04/15 15:56:52 wiz Exp $ */
/*-
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
* All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: apropos-utils.c,v 1.3 2012/04/07 10:44:58 apb Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.4 2012/04/15 15:56:52 wiz Exp $");
#include <sys/stat.h>
@@ -449,6 +449,8 @@
const char *name_desc;
const char *machine;
const char *snippet;
+ const char *name_temp;
+ char *slash_ptr;
char *m = NULL;
int rc;
inverse_document_frequency idf = {0, 0};
@@ -549,13 +551,16 @@
while (sqlite3_step(stmt) == SQLITE_ROW) {
section = (const char *) sqlite3_column_text(stmt, 0);
+ name_temp = (const char *) sqlite3_column_text(stmt, 1);
name_desc = (const char *) sqlite3_column_text(stmt, 2);
machine = (const char *) sqlite3_column_text(stmt, 3);
snippet = (const char *) sqlite3_column_text(stmt, 4);
+ if ((slash_ptr = strrchr(name_temp, '/')) != NULL)
+ name_temp = slash_ptr + 1;
if (machine && machine[0]) {
m = estrdup(machine);
easprintf(&name, "%s/%s", lower(m),
- sqlite3_column_text(stmt, 1));
+ name_temp);
free(m);
} else {
name = estrdup((const char *) sqlite3_column_text(stmt, 1));
diff -r 30085259a76f -r e75840218e29 usr.sbin/makemandb/apropos.c
--- a/usr.sbin/makemandb/apropos.c Sun Apr 15 15:35:00 2012 +0000
+++ b/usr.sbin/makemandb/apropos.c Sun Apr 15 15:56:52 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos.c,v 1.5 2012/02/15 23:53:13 joerg Exp $ */
+/* $NetBSD: apropos.c,v 1.6 2012/04/15 15:56:52 wiz Exp $ */
/*-
* Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
* All rights reserved.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: apropos.c,v 1.5 2012/02/15 23:53:13 joerg Exp $");
+__RCSID("$NetBSD: apropos.c,v 1.6 2012/04/15 15:56:52 wiz Exp $");
#include <err.h>
#include <search.h>
@@ -216,7 +216,7 @@
callback_data *cbdata = (callback_data *) data;
FILE *out = cbdata->out;
cbdata->count++;
- fprintf(out, "%s(%s)\t%s\n", name, section, name_desc);
+ fprintf(out, "%s (%s)\t%s\n", name, section, name_desc);
if (cbdata->aflags->no_context == 0)
fprintf(out, "%s\n\n", snippet);
Home |
Main Index |
Thread Index |
Old Index