-/* $Id: main.c,v 1.316 2019/01/01 08:18:11 schwarze Exp $ */
+/* $Id: main.c,v 1.322 2019/03/06 10:18:58 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010-2012, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2012, 2014-2019 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/param.h> /* MACHINE */
-#include <sys/termios.h>
#include <sys/wait.h>
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+#include <termios.h>
#include <time.h>
#include <unistd.h>
setprogname(progname);
#endif
+ mandoc_msg_setoutfile(stderr);
if (strncmp(progname, "mandocdb", 8) == 0 ||
strcmp(progname, BINM_MAKEWHATIS) == 0)
return mandocdb(argc, argv);
}
} else
mandoc_msg(MANDOCERR_FILE, 0, 0,
- "%s", strerror(errno));
+ "%s: %s", thisarg, strerror(errno));
if (curp.wstop && mandoc_msg_getrc() != MANDOCLEVEL_OK)
break;
}
if (res != NULL && *ressz == lastsz &&
strchr(*argv, '/') == NULL) {
- if (cfg->sec == NULL)
+ if (cfg->arch != NULL &&
+ arch_valid(cfg->arch, OSENUM) == 0)
+ warnx("Unknown architecture \"%s\".",
+ cfg->arch);
+ else if (cfg->sec == NULL)
warnx("No entry for %s in the manual.",
*argv);
else
if (curp->outdata == NULL)
outdata_alloc(curp);
+ else if (curp->outtype == OUTT_HTML)
+ html_reset(curp);
mandoc_xr_reset();
meta = mparse_result(curp->mp);
char *argv[MAX_PAGER_ARGS];
const char *pager;
char *cp;
+#if HAVE_LESS_T
size_t cmdlen;
+#endif
int argc, use_ofn;
pid_t pager_pid;
/* For less(1), use the tag file. */
use_ofn = 1;
+#if HAVE_LESS_T
if ((cmdlen = strlen(argv[0])) >= 4) {
cp = argv[0] + cmdlen - 4;
if (strcmp(cp, "less") == 0) {
}
}
}
+#endif
if (use_ofn)
argv[argc++] = tag_files->ofn;
argv[argc] = NULL;