aitjcize / cppman

C++ 98/11/14 manual pages for Linux/MacOS
GNU General Public License v3.0
1.27k stars 79 forks source link

C vs C++ man pages #91

Closed jaja360 closed 5 years ago

jaja360 commented 5 years ago

I did the cppman -m true command to be able to use the man command to view c++ man pages. However, I noticed that some pages related to C have been replaced by the version coming from cplusplus.com

For example, the strtok "normal" man page is no longer available. With man strtok, I get the cplusplus.com version.

Is there a way to add only the man pages specific to C++, and keep the man pages of C functions as they were before ?

SGSSGene commented 5 years ago

I failed reproduce this behavior on ubuntu16.04, which Linux distribution are you using?

SGSSGene commented 5 years ago

Can you show us the result from man --path? It gives us the order of search directories.

jaja360 commented 5 years ago

The output of man --path is

/home/jaja27/.local/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man

SGSSGene commented 5 years ago

that is interesting and unexpected. man --path shows on my machine

/usr/local/man:/usr/local/share/man:/usr/share/man:/home/sgssgene/.local/share/man

you can see that the /home/sgssgene/.local/share/man folder is the last, and not like in your case the first entry. man searches in the order of these path for a documentation. This is the reason why for you cppman "overwrites" the normal man results, but in my case it doesn't. Now we have to find where it goes wrong, which is really anoying. You should check

  1. Th file ~/.manpath - It my case it has the content:
    MANDATORY_MANPATH       /home/sgssgene/.local/share/man
  2. any thing stored in $MANPATH you can check by running echo $MANPATH, it should output just an empty line (MANPATH is normally empty). If this is not the case you should check ~/.bashrc or ~/.profile for any entries setting MANPATH.
jaja360 commented 5 years ago

Not sure if it is related, but after running a sudo apt update and restart of the computer, the man --path now shows the correct order:

/usr/local/man:/usr/local/share/man:/usr/share/man:/home/jaja27/.local/share/man

The last updated packages were some new linux kernel (version 4.18.0-13.14). I'm on ubuntu 18.10.

I also tried to reproduce the problem on another computer, also on ubuntu 18.10, but failed to reproduce. The other computer already had the latest linux kernel. So I can't know for sure, but I guess the last update changed something to man and fixed the order of man --path.

SGSSGene commented 5 years ago

Good that it works now. I checked https://launchpad.net/ubuntu/+source/man-db/+changelog but couldn't find any clue to what happened.

Since it is not reproducible I think this ticket should be closed and reopened when this issue appears again.

@aitjcize I think only you can close this issue.

aitjcize commented 5 years ago

@SGSSGene thanks for triaging the issue and all the paste contributions!