=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/read.c,v retrieving revision 1.189 retrieving revision 1.190 diff -c -r1.189 -r1.190 *** src/usr.bin/mandoc/read.c 2020/04/18 20:28:46 1.189 --- src/usr.bin/mandoc/read.c 2020/04/24 11:58:02 1.190 *************** *** 1,4 **** ! /* $OpenBSD: read.c,v 1.189 2020/04/18 20:28:46 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons --- 1,4 ---- ! /* $OpenBSD: read.c,v 1.190 2020/04/24 11:58:02 schwarze Exp $ */ /* * Copyright (c) 2010-2020 Ingo Schwarze * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons *************** *** 552,558 **** struct buf blk; struct buf *save_primary; ! const char *save_filename; size_t offset; int save_filenc, save_lineno; int with_mmap; --- 552,558 ---- struct buf blk; struct buf *save_primary; ! const char *save_filename, *cp; size_t offset; int save_filenc, save_lineno; int with_mmap; *************** *** 560,566 **** if (recursion_depth > 64) { mandoc_msg(MANDOCERR_ROFFLOOP, curp->line, 0, NULL); return; ! } if (read_whole_file(curp, fd, &blk, &with_mmap) == -1) return; --- 560,572 ---- if (recursion_depth > 64) { mandoc_msg(MANDOCERR_ROFFLOOP, curp->line, 0, NULL); return; ! } else if (recursion_depth == 0 && ! (cp = strrchr(filename, '.')) != NULL && ! cp[1] >= '1' && cp[1] <= '9') ! curp->man->filesec = cp[1]; ! else ! curp->man->filesec = '\0'; ! if (read_whole_file(curp, fd, &blk, &with_mmap) == -1) return;