=================================================================== RCS file: /cvs/mandoc/mandocdb.c,v retrieving revision 1.268 retrieving revision 1.272 diff -u -p -r1.268 -r1.272 --- mandoc/mandocdb.c 2021/08/07 13:02:10 1.268 +++ mandoc/mandocdb.c 2023/04/28 19:11:03 1.272 @@ -1,6 +1,6 @@ -/* $Id: mandocdb.c,v 1.268 2021/08/07 13:02:10 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.272 2023/04/28 19:11:03 schwarze Exp $ */ /* - * Copyright (c) 2011-2020 Ingo Schwarze + * Copyright (c) 2011-2021 Ingo Schwarze * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2016 Ed Maste * @@ -532,6 +532,9 @@ out: mpages_free(); ohash_delete(&mpages); ohash_delete(&mlinks); +#if DEBUG_MEMORY + mandoc_dbg_finish(); +#endif return exitcode; usage: progname = getprogname(); @@ -629,6 +632,8 @@ treescan(void) say(path, "&stat"); continue; } + if ((ff->fts_statp->st_mode & S_IFMT) != S_IFREG) + continue; /* FALLTHROUGH */ /* @@ -799,7 +804,7 @@ filescan(const char *infile) * We have to do lstat(2) before realpath(3) loses * the information whether this is a symbolic link. * We need to know that because for symbolic links, - * we want to use the orginal file name, while for + * we want to use the original file name, while for * regular files, we want to use the real path. */ if (lstat(infile, &st) == -1) { @@ -2249,11 +2254,11 @@ dbwrite(struct dba *dba) say(tfn, "&dba_write"); goto err; } - if ((fd1 = open(MANDOC_DB, O_RDONLY, 0)) == -1) { + if ((fd1 = open(MANDOC_DB, O_RDONLY)) == -1) { say(MANDOC_DB, "&open"); goto err; } - if ((fd2 = open(tfn, O_RDONLY, 0)) == -1) { + if ((fd2 = open(tfn, O_RDONLY)) == -1) { say(tfn, "&open"); goto err; }