Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makemandb PR bin/54343: We want the callback_args....
details: https://anonhg.NetBSD.org/src/rev/3cac769e0278
branches: trunk
changeset: 1002845:3cac769e0278
user: abhinav <abhinav%NetBSD.org@localhost>
date: Sun Aug 18 09:14:30 2019 +0000
description:
PR bin/54343: We want the callback_args.machine to be NULL if it is not present in the DB.
The previous commit fixed the problem of allowing apropos to not crash and
produce output even if the database is missing values for certain mandatory
fields, such as name, section etc. Normally we don't expect those values
to be missing in the database but in case of parsing errors it can happen.
However, the machine architecture is an optional field since not all man pages
are hardware specific so that should be allowed to be set to NULL if not
present in the database.
diffstat:
usr.sbin/makemandb/apropos-utils.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 9bfbedd666db -r 3cac769e0278 usr.sbin/makemandb/apropos-utils.c
--- a/usr.sbin/makemandb/apropos-utils.c Sun Aug 18 09:05:49 2019 +0000
+++ b/usr.sbin/makemandb/apropos-utils.c Sun Aug 18 09:14:30 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: apropos-utils.c,v 1.46 2019/08/15 10:29:07 christos Exp $ */
+/* $NetBSD: apropos-utils.c,v 1.47 2019/08/18 09:14:30 abhinav 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.46 2019/08/15 10:29:07 christos Exp $");
+__RCSID("$NetBSD: apropos-utils.c,v 1.47 2019/08/18 09:14:30 abhinav Exp $");
#include <sys/queue.h>
#include <sys/stat.h>
@@ -705,7 +705,7 @@
callback_args.section = get_stmt_col_text(stmt, 0);
name_temp = get_stmt_col_text(stmt, 1);
callback_args.name_desc = get_stmt_col_text(stmt, 2);
- callback_args.machine = get_stmt_col_text(stmt, 3);
+ callback_args.machine = (const char *) sqlite3_column_text(stmt, 3);
if (!args->legacy) {
callback_args.snippet = get_stmt_col_text(stmt, 4);
callback_args.snippet_length =
Home |
Main Index |
Thread Index |
Old Index