Home | History | Annotate | Download | only in regex
History log of /src/lib/libc/regex/regerror.c
RevisionDateAuthorComments
 1.26  05-Nov-2022  riastradh regerror(3): Allow null errbuf if errbuf_size is zero.

The man page says:

If errbuf_size is 0, errbuf is ignored but the return value is still
correct.

POSIX says:

If errbuf_size is 0, regerror() shall ignore the errbuf argument,
and return the size of the buffer needed to hold the generated
string.

https://pubs.opengroup.org/onlinepubs/9699919799/functions/regerror.html

from enh@google.com
 1.25  26-Feb-2021  christos Arrange for tools build
 1.24  23-Feb-2021  christos sync with FreeBSD:
- NLS support
- GNU extensions
- bug fixes
 1.23  09-Feb-2007  junyoung Rearrange headers for better portability.
 1.22  08-Feb-2007  junyoung ANSIfy.
 1.21  08-Feb-2007  junyoung Nuke __P.
 1.20  02-Dec-2005  yamt constify and remove __UNCONST.
 1.19  29-Nov-2005  christos WARNS=4
 1.18  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.17  17-Nov-2002  itojun use strlcpy where it is more appropriate.
 1.16  22-Jan-2000  mycroft branches: 1.16.6;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.15  20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.14  17-Sep-1999  kleink The previous assertion change was incorrect: the preg argument is permitted to
be NULL (part of the interface definition!) unless errcode is REG_ATOI, which
is a non-portable extension.

Also, remove assertions from the local regatoi() function, as they are either
redundant or will never fail due to the buffer allocation for that argument in
regerror().
 1.13  16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12  08-Dec-1998  drochner correct a comment, minor formatting
 1.11  14-Nov-1998  christos Delint:
- we don't need to use longs; convert to use int32_t.
- remove break statements after returns.
- cast things properly.
 1.10  26-Jul-1998  mycroft const poisoning.
 1.9  26-Jul-1998  mycroft constify some tables.
 1.8  03-Feb-1998  perry remove obsolete register declarations
 1.7  21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.6  13-Jul-1997  christos Add braces in initializers.
Fix RCSID's
Remove unused variables
 1.5  23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.4  27-Feb-1995  cgd add unintrusive Ids
 1.3  30-Jan-1995  cgd clean up import; kill old cruft.
 1.2  11-Nov-1993  jtc Update to Henry's Nov 2, 1993 alpha3.2 release.
 1.1  10-Nov-1993  jtc branches: 1.1.1;
Henry Spencer's POSIX.2 compatibile regular expression matching routines.
 1.1.1.1  30-Jan-1995  cgd regex code from lite. same as we're using, but slightly cleaner.
 1.16.6.1  10-Dec-2002  thorpej Sync with HEAD.

RSS XML Feed