From 30fa26bdf266b1817f2f3a120dc953fc16098091 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 6 Dec 2014 01:23:24 +0000 Subject: When opening mandoc.db fails, tell the user in which directory. Improving an unhelpful error message reported by millert@. --- mansearch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mansearch.c') diff --git a/mansearch.c b/mansearch.c index 77d4c074..dbfbe025 100644 --- a/mansearch.c +++ b/mansearch.c @@ -1,4 +1,4 @@ -/* $Id: mansearch.c,v 1.51 2014/11/27 01:58:21 schwarze Exp $ */ +/* $Id: mansearch.c,v 1.52 2014/12/06 01:23:24 schwarze Exp $ */ /* * Copyright (c) 2012 Kristaps Dzonsons * Copyright (c) 2013, 2014 Ingo Schwarze @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -246,7 +247,8 @@ mansearch(const struct mansearch *search, SQLITE_OPEN_READONLY, NULL); if (SQLITE_OK != c) { - perror(MANDOC_DB); + fprintf(stderr, "%s/%s: %s\n", + paths->paths[i], MANDOC_DB, strerror(errno)); sqlite3_close(db); continue; } -- cgit v1.2.3-56-ge451