[PATCH v9] regex.3: Desoupify regerror() description

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

 



Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@xxxxxxxxxxxxxxxxxx>
---
Range-diff against v8:
1:  4479e1572 ! 1:  38109fcc6 regex.3: Desoupify regerror() description
    @@ man3/regex.3: .SS Error reporting
     +.IR preg .
     +.PP
     +If
    -+.I errbuf_size
    -+is
    -+.BR 0 ,
    -+the size of the required buffer is returned.
    -+Otherwise, up to
      .I errbuf_size
     -are nonzero,
     -.I errbuf
     -is filled in with the first
     -.I "errbuf_size \- 1"
     -characters of the error message and a terminating null byte (\[aq]\e0\[aq]).
    ++isn't 0, up to
    ++.I errbuf_size
     +bytes are copied to
     +.IR errbuf ;
     +the error string is always null-terminated, and truncated to fit.
      .SS Freeing
      .BR regfree ()
      deinitializes the pattern buffer at
    +@@ man3/regex.3: .SH RETURN VALUE
    + returns zero for a successful match or
    + .B REG_NOMATCH
    + for failure.
    ++.PP
    ++.BR regerror ()
    ++returns the size of the buffer required to hold the string.
    + .SH ERRORS
    + The following errors can be returned by
    + .BR regcomp ():

 man3/regex.3 | 36 ++++++++++++++++--------------------
 1 file changed, 16 insertions(+), 20 deletions(-)

diff --git a/man3/regex.3 b/man3/regex.3
index d91acc19d..efca582d7 100644
--- a/man3/regex.3
+++ b/man3/regex.3
@@ -210,27 +210,20 @@ .SS Error reporting
 .BR regexec ()
 into error message strings.
 .PP
-.BR regerror ()
-is passed the error code,
-.IR errcode ,
-the pattern buffer,
-.IR preg ,
-a pointer to a character string buffer,
-.IR errbuf ,
-and the size of the string buffer,
-.IR errbuf_size .
-It returns the size of the
-.I errbuf
-required to contain the null-terminated error message string.
-If both
-.I errbuf
-and
+If
+.I preg
+isn't a null pointer,
+.I errcode
+must be the latest error returned from an operation on
+.IR preg .
+.PP
+If
 .I errbuf_size
-are nonzero,
-.I errbuf
-is filled in with the first
-.I "errbuf_size \- 1"
-characters of the error message and a terminating null byte (\[aq]\e0\[aq]).
+isn't 0, up to
+.I errbuf_size
+bytes are copied to
+.IR errbuf ;
+the error string is always null-terminated, and truncated to fit.
 .SS Freeing
 .BR regfree ()
 deinitializes the pattern buffer at
@@ -247,6 +240,9 @@ .SH RETURN VALUE
 returns zero for a successful match or
 .B REG_NOMATCH
 for failure.
+.PP
+.BR regerror ()
+returns the size of the buffer required to hold the string.
 .SH ERRORS
 The following errors can be returned by
 .BR regcomp ():
-- 
2.30.2

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux