View Issue Details

IDProjectCategoryView StatusLast Update
0000452fileGeneralpublic2023-06-01 16:01
Reporterlukem Assigned Tochristos  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
OSNetBSDOS Version10.99.4  
Product Version5.43 
Fixed in Version5.45 
Summary0000452: mdoc man pages misidentified as C source
DescriptionI noticed that file 5.43 (as nbfile tool in NetBSD-current) misidentifies various mdoc man pages as C source.

If I use file 5.41 on macOS 13.4 on the same source tree, it misidentifies a smaller subset.


Steps To Reproducecd src/lib/libc
find . -name '*.[1-9]' | xargs path/to/file | grep -v 'troff or' | sort
./gen/ctype.3: C source, ASCII text
./gen/getdevmajor.3: C source, ASCII text
./gen/randomid.3: C source, ASCII text
./locale/nl_langinfo.3: C source, ASCII text
./net/getifaddrs.3: C source, ASCII text
./sys/dup.2: C source, ASCII text
./sys/mremap.2: C source, ASCII text
./sys/readlink.2: C source, ASCII text
./sys/select.2: C source, ASCII text
./sys/undelete.2: C source, ASCII text
Additional InformationI discovered this whilst debugging NetBSD/src/share/man/man0 and observing different behaviour between the host file and the TOOLDIR nbfile, and realised that both were buggy, one was less buggy than the other.
TagsNo tags attached.

Activities

polluks

2023-05-22 12:05

reporter   ~0003942

At least NetBSD 9.3 file-5.37 says
$ file /usr/share/man/man3/ctype.3
/usr/share/man/man3/ctype.3: troff or preprocessor input, ASCII text

lukem

2023-05-22 12:10

reporter   ~0003943

Yes, file 5.43 seems to detect more of that list as C instead of troff, but file 5.37 will still misidentify some of that list.

Using file 5.37 (NetBSD 9.0, ftp.netbsd.org), checking /usr/share/man there's a bunch of mismatches including those I listed from libc.

./man1/flex.1: C source, ASCII text
./man1/lex.1: C source, ASCII text
./man1/calendar.1: C source, ASCII text
./man1/ident.1: C source, ASCII text
./man1/makeinfo.1: HTML document, ASCII text
./man1/sqlite3.1: HTML document, ASCII text
./man2/dup2.2: C source, ASCII text
./man2/dup.2: C source, ASCII text
./man2/dup3.2: C source, ASCII text
./man2/mremap.2: C source, ASCII text

...

christos

2023-06-01 16:01

manager   ~0003946

Fixed, thanks!

Issue History

Date Modified Username Field Change
2023-05-22 10:13 lukem New Issue
2023-05-22 12:05 polluks Note Added: 0003942
2023-05-22 12:10 lukem Note Added: 0003943
2023-06-01 16:00 christos Assigned To => christos
2023-06-01 16:00 christos Status new => assigned
2023-06-01 16:01 christos Status assigned => resolved
2023-06-01 16:01 christos Resolution open => fixed
2023-06-01 16:01 christos Fixed in Version => 5.45
2023-06-01 16:01 christos Note Added: 0003946