[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#53737: perror(3) and its man page out of sync



Package: glibc-doc
Version:

Man page says, perror() will print the string, a colon, a blank and then
some helpful error message:
-----| man 3 perror |-----
                                                     The argument
       string s is printed first, then a colon and a blank,  then
       the  message and a new-line.  
/-----| man 3 perror |-----

However, the colon is only printed if there is a non-empty string to print
before the error message:

[jbglaw@parkautomat:/home/jbglaw] $> cat test.c
#include <stdio.h>

int main(int argc, char argv[]) {
        perror(NULL);
        perror("");
        perror("some real text");
        exit(0);
}
[jbglaw@parkautomat:/home/jbglaw] $> gcc -o test test.c
[jbglaw@parkautomat:/home/jbglaw] $> ./test
Success
Success
some real text: Success
[jbglaw@parkautomat:/home/jbglaw] $>


Even if it makes some sense to omit the colon in the first two lines, I think
perror should behave just as the man page states. If someone wants to 
access the pure error messages, he just may use sys_errlist[].

MfG, JBG

-- 
Fehler eingestehen, Größe zeigen: Nehmt die Rechtschreibreform zurück!!!
keyID=0x8399E1BB fingerprint=250D 3BCF 7127 0D8C A444 A961 1DBD 5E75 8399 E1BB

Attachment: pgpDNh1YKLyNs.pgp
Description: PGP signature


Reply to: