Package: file
Version: 1:5.45-3+b1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with a new version

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z < "man 
page"

  [Use "groff -e ' $' -e '\\~$' <file>" to find obvious trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?


troff:<stdin>:71: warning: trailing space in the line
troff:<stdin>:451: warning: name 'doc-list-type-stack0' not defined
doc.tmac:<stdin>:451: error: .It without preceding .Bl
troff:<stdin>:451: warning: register 'doc--type' not defined
troff:<stdin>:451: warning: name 'doc-' not defined (possibly missing space 
after 'do')
doc.tmac:<stdin>:527: error: .It without preceding .Bl
troff:<stdin>:527: warning: name 'doc-' not defined (possibly missing space 
after 'do')
troff:<stdin>:538: warning: register 'doc-list-indent-stack0' not defined
troff:<stdin>:538: warning: register 'doc-list-offset-stack0' not defined
doc.tmac:<stdin>:538: warning: extraneous .El call
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:655: warning: tab character in unquoted macro argument
troff:<stdin>:656: warning: tab character in unquoted macro argument
troff:<stdin>:657: warning: tab character in unquoted macro argument
troff:<stdin>:658: warning: tab character in unquoted macro argument
troff:<stdin>:659: warning: tab character in unquoted macro argument
troff:<stdin>:660: warning: tab character in unquoted macro argument
troff:<stdin>:661: warning: tab character in unquoted macro argument
troff:<stdin>:662: warning: tab character in unquoted macro argument
troff:<stdin>:663: warning: tab character in unquoted macro argument
troff:<stdin>:664: warning: tab character in unquoted macro argument
troff:<stdin>:665: warning: tab character in unquoted macro argument


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.12.12-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), 
LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages libmagic1t64 depends on:
ii  libbz2-1.0    1.0.8-6
ii  libc6         2.40-6
ii  liblzma5      5.6.3-1+b1
ii  libmagic-mgc  1:5.45-3+b1
ii  zlib1g        1:1.3.dfsg+really1.3.1-1+b1

libmagic1t64 recommends no packages.

Versions of packages libmagic1t64 suggests:
ii  file  1:5.45-3+b1

Versions of packages file depends on:
ii  libc6  2.40-6

-- no debconf information
Input file is magic.5

Output from "mandoc -T lint  magic.5": (shortened list)

      2 input text line longer than 80 bytes: A 32-bit single prec...
      2 input text line longer than 80 bytes: A 64-bit double prec...
      1 input text line longer than 80 bytes: If neither a byte or...
      1 no blank before trailing delimiter: Dv /number,
      1 skipping end of block that is not open: El
      1 skipping item outside list: It Dv message
      1 skipping item outside list: It Dv test
      1 whitespace at end of input line

-.-.

Output from "test-groff -mandoc -t -ww -z magic.5": (shortened list)

      2 .It without preceding .Bl
      1 extraneous .El call
      2 name 'doc-' not defined (possibly missing space after 'do')
      1 name 'doc-list-type-stack0' not defined
      1 register 'doc--type' not defined
      1 register 'doc-list-indent-stack0' not defined
      1 register 'doc-list-offset-stack0' not defined
     14 tab character in unquoted macro argument
      1 trailing space in the line

-.-.

Remove space characters (whitespace) at the end of lines.
Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

Number of lines affected is

1

-.-.

Add a (no-break, "\ " or "\~") space between a number and a unit,
as these are not one entity.

273:to 8KiB.

-.-.
758:\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string       PK\e3\e4 \eb, ZIP 
self-extracting archive

-.-.

Find a repeated word

! 45 --> end

-.-.

Add a comma (or \&) after "e.g." and "i.e.", or use English words
(man-pages(7)).
Abbreviation points should be protected against being interpreted as
an end of sentence, if they are not, and that independent of the
current place on the line.

96:Trim the string, i.e. leading and trailing whitespace
456:with the usual escapes permitted (e.g. \en for new-line).
493:Numeric values are specified in C form; e.g.
551:i.e. the literal string
566:i.e. the literal string

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.

Line 66, length 89

A 32-bit single precision IEEE floating point number in this machine's native 
byte order.

Line 68, length 89

A 64-bit double precision IEEE floating point number in this machine's native 
byte order.

Line 189, length 81

A 32-bit single precision IEEE floating point number in little-endian byte 
order.

Line 191, length 81

A 64-bit double precision IEEE floating point number in little-endian byte 
order.

Line 272, length 81

If neither a byte or line count is specified, the search is limited 
automatically

Line 721, length 87

\*[Gt]\*[Gt]\*[Gt]\*[Am](2.s-514) string  LE      LE executable (MS Windows VxD 
driver)

Line 742, length 89

\*[Gt]\*[Gt]\*[Gt]\*[Am](\*[Am]0x54.l-3)  string  UNACE  \eb, ACE 
self-extracting archive

Line 758, length 97

\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string       PK\e3\e4 \eb, ZIP 
self-extracting archive


-.-.

Use \(en (en-dash) for a dash at the beginning (en) of a line,
or between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

magic.5:774:\- the command that reads this file.

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".


magic.5:39:A number specifying the offset (in bytes) into the file of the data
magic.5:44:The first direct offset of the magic entry (at continuation level 0),
magic.5:426:Each top-level magic pattern (see below for an explanation of 
levels)
magic.5:456:with the usual escapes permitted (e.g. \en for new-line).
magic.5:699:position (when indirection was used before) of preceding fields.

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -rCHECKSTYLE=10 -ww -z 
":

troff:<stdin>:71: warning: trailing space in the line
troff:<stdin>:451: warning: name 'doc-list-type-stack0' not defined
doc.tmac:<stdin>:451: error: .It without preceding .Bl
troff:<stdin>:451: warning: register 'doc--type' not defined
troff:<stdin>:451: warning: name 'doc-' not defined (possibly missing space 
after 'do')
doc.tmac:<stdin>:527: error: .It without preceding .Bl
troff:<stdin>:527: warning: name 'doc-' not defined (possibly missing space 
after 'do')
troff:<stdin>:538: warning: register 'doc-list-indent-stack0' not defined
troff:<stdin>:538: warning: register 'doc-list-offset-stack0' not defined
doc.tmac:<stdin>:538: warning: extraneous .El call
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:654: warning: tab character in unquoted macro argument
troff:<stdin>:655: warning: tab character in unquoted macro argument
troff:<stdin>:656: warning: tab character in unquoted macro argument
troff:<stdin>:657: warning: tab character in unquoted macro argument
troff:<stdin>:658: warning: tab character in unquoted macro argument
troff:<stdin>:659: warning: tab character in unquoted macro argument
troff:<stdin>:660: warning: tab character in unquoted macro argument
troff:<stdin>:661: warning: tab character in unquoted macro argument
troff:<stdin>:662: warning: tab character in unquoted macro argument
troff:<stdin>:663: warning: tab character in unquoted macro argument
troff:<stdin>:664: warning: tab character in unquoted macro argument
troff:<stdin>:665: warning: tab character in unquoted macro argument

-.-

Spelling:

Arpril -> April

-.-

Fix warnings from "mandoc" and "test-groff".

-.-

Use the table preprocessor (tbl) for a table.
--- magic.5     2025-02-12 08:24:49.117094939 +0000
+++ magic.5.new 2025-02-13 03:52:00.334327972 +0000
@@ -1,5 +1,5 @@
 .\" $File: magic.man,v 1.103 2023/07/20 14:32:07 christos Exp $
-.Dd Arpil 18, 2023
+.Dd April 18, 2023
 .Dt MAGIC 5
 .Os
 .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
@@ -42,14 +42,14 @@ This offset can be a negative number if
 .Bl -bullet  -compact
 .It
 The first direct offset of the magic entry (at continuation level 0),
-in which case it is interpreted an offset from end end of the file
+in which case it is interpreted an offset from end of the file
 going backwards.
 This works only when a file descriptor to the file is available and it
 is a regular file.
 .It
 A continuation offset relative to the end of the last up-level field
 .Dv ( \*[Am] ) .
-.El
+.El\"End of .Bl -bullet  -compact
 .It Dv type
 The type of the data to be tested.
 The possible values are:
@@ -63,12 +63,14 @@ A four-byte value in this machine's nati
 .It Dv quad
 An eight-byte value in this machine's native byte order.
 .It Dv float
-A 32-bit single precision IEEE floating point number in this machine's native 
byte order.
+A 32-bit single precision IEEE floating point number in this machine's
+native byte order.
 .It Dv double
-A 64-bit double precision IEEE floating point number in this machine's native 
byte order.
+A 64-bit double precision IEEE floating point number in this machine's
+native byte order.
 .It Dv string
 A string of bytes.
-The string type specification can be optionally followed by a /<width> 
+The string type specification can be optionally followed by a /<width>
 option and optionally followed by a set of flags /[bCcftTtWw]*.
 The width limits the number of characters to be copied.
 Zero means all characters.
@@ -93,7 +95,7 @@ and
 .It f
 Require that the matched string is a full word, not a partial word match.
 .It T
-Trim the string, i.e. leading and trailing whitespace
+Trim the string, i.e., leading and trailing whitespace
 .It t
 Force text file test.
 .It W
@@ -107,7 +109,7 @@ consecutive blanks to match.
 .It w
 Treat every blank in the magic as an optional blank.
 is deleted before the string is printed.
-.El
+.El\"End of .Bl -tag -width B -compact -offset XXXX; line 76
 .It Dv pstring
 A Pascal-style string where the first byte/short/int is interpreted as the
 unsigned length.
@@ -126,7 +128,7 @@ A 4 byte big endian length.
 A 4 byte little endian length.
 .It J
 The length includes itself in its count.
-.El
+.El\" End of .Bl -tag -width B -compact -offset XXXX; line 116
 The string is not NUL terminated.
 .Dq J
 is used rather than the more
@@ -186,9 +188,11 @@ A four-byte value in little-endian byte
 .It Dv lequad
 An eight-byte value in little-endian byte order.
 .It Dv lefloat
-A 32-bit single precision IEEE floating point number in little-endian byte 
order.
+A 32-bit single precision IEEE floating point number in little-endian
+byte order.
 .It Dv ledouble
-A 64-bit double precision IEEE floating point number in little-endian byte 
order.
+A 64-bit double precision IEEE floating point number in little-endian
+byte order.
 .It Dv ledate
 A four-byte value in little-endian byte order,
 interpreted as a UNIX date.
@@ -269,8 +273,8 @@ byte count.
 Lines are delimited by the platforms native line delimiter.
 When a line count is specified, an implicit byte count also computed assuming
 each line is 80 characters long.
-If neither a byte or line count is specified, the search is limited 
automatically
-to 8KiB.
+If neither a byte or line count is specified,
+the search is limited automatically to 8\~KiB.
 .Dv ^
 and
 .Dv $
@@ -280,7 +284,7 @@ not beginning and end of file.
 A literal string search starting at the given offset.
 The same modifier flags can be used as for string patterns.
 The search expression must contain the range in the form
-.Dv /number,
+.Dv /number ,
 that is the number of positions at which the match will be
 attempted, starting from the start offset.
 This is suitable for
@@ -353,14 +357,14 @@ This is a quad value indicating the curr
 It can be used to determine the size of the file or the magic buffer.
 For example the magic entries:
 .Bd -literal -offset indent
--0     offset  x       this file is %lld bytes
--0     offset  <=100   must be more than 100 \e
+\-0    offset  x       this file is %lld bytes
+\-0    offset  <=100   must be more than 100 \e
     bytes and is only %lld
 .Ed
 .It Dv octal
 A string representing an octal number.
-.El
-.El
+.El\" End of .Bl -tag -width ".Dv lestring16"; line 56
+.El\" End of .Bl -tag -width ".Dv message"; line 37
 .Pp
 For compatibility with the Single
 .Ux
@@ -448,12 +452,13 @@ numeric value before any comparisons are
 Prepending a
 .Dv u
 to the type indicates that ordered comparisons should be unsigned.
+.Bl -tag -width ".Dv message"
 .It Dv test
 The value to be compared with the value from the file.
 If the type is
 numeric, this value
 is specified in C form; if it is a string, it is specified as a C string
-with the usual escapes permitted (e.g. \en for new-line).
+with the usual escapes permitted (e.g., \en for new-line).
 .Pp
 Numeric values
 may be preceded by a character indicating the operation to be performed.
@@ -490,7 +495,7 @@ specifies that the line matches if the t
 .Em not
 succeed.
 .Pp
-Numeric values are specified in C form; e.g.
+Numeric values are specified in C form; e.g.,
 .Dv 13
 is decimal,
 .Dv 013
@@ -535,7 +540,7 @@ If the string begins with
 the message printed is the remainder of the string with no whitespace
 added before it: multiple matches are normally separated by a single
 space.
-.El
+.El\" End of .Bl -tag -width ".Dv message"; line 451
 .Pp
 An APPLE 4+4 character APPLE creator and type can be specified as:
 .Bd -literal -offset indent
@@ -548,7 +553,7 @@ as:
 !:ext  ext[/ext...]
 .Ed
 .Pp
-i.e. the literal string
+i.e., the literal string
 .Dq !:ext
 followed by a slash-separated list of commonly found extensions; for example
 for JPEG images:
@@ -563,7 +568,7 @@ file type, and has the following format:
 !:mime MIMETYPE
 .Ed
 .Pp
-i.e. the literal string
+i.e., the literal string
 .Dq !:mime
 followed by the MIME type.
 .Pp
@@ -577,7 +582,7 @@ The operand
 .Dv OP
 can be:
 .Dv + ,
-.Dv - ,
+.Dv \- ,
 .Dv * ,
 or
 .Dv /
@@ -650,20 +655,22 @@ To that number the value of
 is added and the result is used as an offset in the file.
 The default type if one is not specified is long.
 The following types are recognized:
-.Bl -column -offset indent "Type" "Half/Short" "Little" "Size"
-.It Sy Type    Sy Mnemonic     Sy Endian       Sy Size
-.It bcBc       Byte/Char       N/A     1
-.It efg        Double  Little  8
-.It EFG        Double  Big     8
-.It hs Half/Short      Little  2
-.It HS Half/Short      Big     2
-.It i  ID3     Little  4
-.It I  ID3     Big     4
-.It m  Middle  Middle  4
-.It o  Octal   Textual Variable
-.It q  Quad    Little  8
-.It Q  Quad    Big     8
-.El
+.TS
+lB lB lB lB
+l  l  l  l .
+type   Mnemonic        Endian  Size
+bcBc   Byte/Char       N/A     1
+efg    Double  Little  8
+EFG    Double  Big     8
+hs     Half/Short      Little  2
+HS     Half/Short      Big     2
+i      ID3     Little  4
+I      ID3     Big     4
+m      Middle  Middle  4
+o      Octal   Textual Variable
+q      Quad    Little  8
+Q      Quad    Big     8
+.TE
 .Pp
 That way variable length structures can be examined:
 .Bd -literal -offset indent
@@ -755,7 +762,7 @@ start of the main indirect offset.
 \*[Gt]\*[Gt]\*[Gt]\*[Am]0xf4          search/0x140 .idata
 # ...and go to the end of it, calculated from start+length;
 # these are located 14 and 10 bytes after the section name
-\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string       PK\e3\e4 \eb, ZIP 
self-extracting archive
+\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(\-4)) string       PK\e3\e4 \eb, ZIP 
self-extracting archive
 .Ed
 .Pp
 If you have a list of known values at a particular continuation level,
@@ -771,7 +778,7 @@ and you want to provide a switch-like de
 .Ed
 .Sh SEE ALSO
 .Xr file 1
-\- the command that reads this file.
+\(en the command that reads this file.
 .Sh BUGS
 The formats
 .Dv long ,
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8 <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  Any "autogenerator" should check its products with the above mentioned
'groff', 'mandoc', and additionally with 'nroff ...'.

  It should also check its input files for too long (> 80) lines.

  This is just a simple quality control measure.

  The "autogenerator" may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  Not beginning each input sentence on a new line.
Line length should thus be reduced.

  The script "reportbug" uses 'quoted-printable' encoding when a line is
longer than 1024 characters in an 'ascii' file.

  See man-pages(7), item "semantic newline".

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -d -u <out1> <out2>

and for groff, using

\"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - \"

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output from 'diff -d -u ...' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option \"-warnings=w\"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT=\"-ww -b -z\"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-

Reply via email to