View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000455 | file | General | public | 2023-06-02 02:13 | 2023-06-16 19:40 |
Reporter | raf | Assigned To | christos | ||
Priority | low | Severity | text | Reproducibility | N/A |
Status | resolved | Resolution | fixed | ||
Platform | All | OS | All | OS Version | All |
Product Version | 5.44 | ||||
Fixed in Version | 5.45 | ||||
Summary | 0000455: Incomplete documentation for magic_getpath in libmagic.man | ||||
Description | The libmagic manual entry only mentions magic_getpath() in relation to its return value. It doesn't include it in the list of available functions, and it doesn't explain what it does. Below, in the additional information section, is a patch to fix that. Technically, the existing statement that magic_getpath() returns NULL on error isn't true. It returns the system default path whenever there is an error, but it's probably harmless to leave that. | ||||
Steps To Reproduce | Run "man libmagic" then search for "magic_getpath". | ||||
Additional Information | diff --git a/doc/libmagic.man b/doc/libmagic.man index f006c828..ec5cca0c 100644 --- a/doc/libmagic.man +++ b/doc/libmagic.man @@ -84,6 +84,8 @@ .Fn magic_setparam "magic_t cookie" "int param" "const void *value" .Ft int .Fn magic_version "void" +.Ft const char * +.Fn magic_getpath "const char *magicfile" "int action" .Sh DESCRIPTION These functions operate on the magic database file @@ -347,6 +349,18 @@ from .In magic.h . This can be used by client programs to verify that the version they compile against is the same as the version that they run against. +.Pp +The +.Fn magic_getpath +command returns the colon separated list of magic database locations. If the +.Fa filename +is non-NULL, then it is returned. Otherwise, if the +.Dv MAGIC +environment variable is defined, then it is returned. +Otherwise, if +.Fa action +is 0 (meaning "file load"), then any user-specific magic database file is included. +Otherwise, only the system default magic database path is included. .Sh RETURN VALUES The function .Fn magic_open | ||||
Tags | patch | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
2023-06-02 02:13 | raf | New Issue | |
2023-06-02 02:13 | raf | Tag Attached: patch | |
2023-06-16 19:39 | christos | Assigned To | => christos |
2023-06-16 19:39 | christos | Status | new => assigned |
2023-06-16 19:40 | christos | Status | assigned => resolved |
2023-06-16 19:40 | christos | Resolution | open => fixed |
2023-06-16 19:40 | christos | Fixed in Version | => 5.45 |
2023-06-16 19:40 | christos | Note Added: 0003949 |