Print this page
9718 update mandoc to 1.14.4

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/mandoc/mansearch.c
          +++ new/usr/src/cmd/mandoc/mansearch.c
   1      -/*      $Id: mansearch.c,v 1.76 2017/08/02 13:29:04 schwarze Exp $ */
        1 +/*      $Id: mansearch.c,v 1.77 2017/08/22 17:50:11 schwarze Exp $ */
   2    2  /*
   3    3   * Copyright (c) 2012 Kristaps Dzonsons <kristaps@bsd.lv>
   4    4   * Copyright (c) 2013-2017 Ingo Schwarze <schwarze@openbsd.org>
   5    5   *
   6    6   * Permission to use, copy, modify, and distribute this software for any
   7    7   * purpose with or without fee is hereby granted, provided that the above
   8    8   * copyright notice and this permission notice appear in all copies.
   9    9   *
  10   10   * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
  11   11   * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
↓ open down ↓ 169 lines elided ↑ open up ↑
 181  181                                  break;
 182  182                          }
 183  183                          if (cur + 1 > maxres) {
 184  184                                  maxres += 1024;
 185  185                                  *res = mandoc_reallocarray(*res,
 186  186                                      maxres, sizeof(**res));
 187  187                          }
 188  188                          mpage = *res + cur;
 189  189                          mandoc_asprintf(&mpage->file, "%s/%s",
 190  190                              paths->paths[i], page->file + 1);
      191 +                        if (access(chdir_status ? page->file + 1 :
      192 +                            mpage->file, R_OK) == -1) {
      193 +                                warn("%s", mpage->file);
      194 +                                warnx("outdated mandoc.db contains "
      195 +                                    "bogus %s entry, run makewhatis %s", 
      196 +                                    page->file + 1, paths->paths[i]);
      197 +                                free(mpage->file);
      198 +                                free(rp);
      199 +                                continue;
      200 +                        }
 191  201                          mpage->names = buildnames(page);
 192  202                          mpage->output = buildoutput(outkey, page);
 193  203                          mpage->ipath = i;
 194  204                          mpage->bits = rp->bits;
 195  205                          mpage->sec = *page->sect - '0';
 196  206                          if (mpage->sec < 0 || mpage->sec > 9)
 197  207                                  mpage->sec = 10;
 198  208                          mpage->form = *page->file;
 199  209                          free(rp);
 200  210                          cur++;
↓ open down ↓ 641 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX