View Issue Details

IDProjectCategoryView StatusLast Update
0000503fileGeneralpublic2024-03-01 02:56
Reportermarcoxa Assigned Tochristos  
PrioritynormalSeveritymajorReproducibilityN/A
Status resolvedResolutionfixed 
Product Version5.45 
Fixed in VersionHEAD 
Summary0000503: Man pages imprecisions
DescriptionHi

I have been poring over the manual pages to try to understand some of the fine points of the magic file format. I am referring especially to the magic(5) man page. And I would like to ask for clarifications.

Here are my observations.

When describing "indirect" offsets the explanation contains, IMHO, the following imprecision.

(1) The syntax for indirect addresses is given as

 (( x [[.,][bBcCeEfFgGhHiIlmsSqQ]][+-][ y ])

However, in the examples further below in the man page, there is no double opening parenthesis.

(2) the 'l' "type" is not mentioned in the manual (should it be "long"? Is 'L', for "long" "big endian" missing?).

(3) Given the examples in the man page, it appears that the syntax for indirect addresses is really

 ( x [[.,][bBcCeEfFgGhHiIlmsSqQ]][-+*/%&|^][ y ])

with 'y' that can actually be a (unsigned) number or '('[-+]n')' with 'n' an unsigned number; or maybe with more operators beyond minus and plus? Is this a correct interpretation? If so, the manual should be updated, possibly writing down a full grammar for the indirect addresses.

Does this make sense?

Thanks for the consideration.

Geia sou

Marco
Tagsdocumentation

Activities

christos

2024-03-01 02:56

manager   ~0004014

1. The [[ has been changed to [
2. The Ll types have been added
3. The operators are described later:
If this indirect offset cannot be used directly, simple calculations are
possible: appending
.Em [+-*/%\*[Am]|^]number
inside parentheses allows one to modify
the value read from the file before it is used as an offset:

Thank you!

Issue History

Date Modified Username Field Change
2024-02-12 23:18 marcoxa New Issue
2024-02-12 23:18 marcoxa Tag Attached: documentation
2024-03-01 02:55 christos Assigned To => christos
2024-03-01 02:55 christos Status new => assigned
2024-03-01 02:56 christos Status assigned => resolved
2024-03-01 02:56 christos Resolution open => fixed
2024-03-01 02:56 christos Fixed in Version => HEAD
2024-03-01 02:56 christos Note Added: 0004014