Bug 471784
| Summary: | Problem with makewhatis dans command name with dash | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | pmarion <pmarion19> |
| Component: | man | Assignee: | Ivana Varekova <varekova> |
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 9 | CC: | pspencer, tim, varekova |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2008-11-19 10:35:51 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
pmarion
2008-11-16 09:11:15 UTC
In the script makewhatis the problem seems to be located there
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
I tried to replace
sub(progname"-", progname"---");
I get
ssh---agent [] (1) - authentication agent
It's not the real fix, but a way to locate where could be the solution.
Thanks, fixed in man-1.6f-12.fc11. This is actually the wrong fix. The problem is not in the lines of code
if ($0 ~ progname"-") { # Fix old cat pages
sub(progname"-", progname" - ");
}
-- those lines of code are fine and can be uncommented again.
The actual cause of the problem is that "progname" is set to be the EMPTY STRING.
If it were correctly set to the program name, the above code would be fine and would change things like "ssh-agent-description here" to
"ssh-agent - description here".
However, because it is empty, it causes the observed problem.
That is also why running "whatis man" (for example) gives
man [] (1) - format and display the on-line manual pages
with the empty string in square brackets -- which should not be there!
The real cause of both these problems is earlier:
use_zcat = match(filename,"\\.Z$") ||
match(filename,"\\.z$") || match(filename,"\\.gz$");
if (!use_zcat)
use_bzcat = match(filename,"\\.bz2");
****===> if(!use_bzcat)
use_lzcat = match(filename,"\\.lzma");
if (use_zcat || use_bzcat || use_lzcat ) {
filename_no_gz = substr(filename, 0, RSTART - 1);
} else {
filename_no_gz = filename;
}
match(filename_no_gz, "/[^/]+$");
progname = substr(filename, RSTART + 1, RLENGTH - 1);
The line marked ***====> is the problem. It should be replaced with
if (!use_zcat && ! use_bzcat)
As it stands, with gzipped manpages, z_cat is set to true by the first line, which also sets RSTART to the beginning of the .gz suffix. Then the use_bzcat assignment is (correctly) skipped, leaving use_bzcat false.
Then the problem line sees that use_bzcat is false and tries to assign use_lzcat. In so doing it runs another match command, which fails, and which overwrites RSTART and RLENGTH to zero. The final line then sets progname to the empty string.
In summary:
The fix is to put back in the lines that were commented out in the first fix attempt, and instead to alter the single line marked with ***====> above.
Can somebody with write-access to this bug please reopen it?
Thanks!
For anyone who stumbles here like me: It wasn't fixed until Fedora 11's man-1.6f-21.fc11 (including) at least, Fedora 13's seems to incorporate Philip's patch. |