diff options
author | tjr <tjr@FreeBSD.org> | 2004-07-12 06:07:26 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-07-12 06:07:26 +0000 |
commit | df5304b63cb13fff0de92961ba80dea84c5c552c (patch) | |
tree | 4c57e10772c5dc370c73b755520de78894fdc57b /lib | |
parent | 57e7de678f860b94b4ec21acf2e49439019e3e7f (diff) | |
download | FreeBSD-src-df5304b63cb13fff0de92961ba80dea84c5c552c.zip FreeBSD-src-df5304b63cb13fff0de92961ba80dea84c5c552c.tar.gz |
Add a new error code, REG_ILLSEQ, to indicate that a regular expression
contains an illegal multibyte character sequence.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/regex/regerror.c | 2 | ||||
-rw-r--r-- | lib/libc/regex/regex.3 | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/libc/regex/regerror.c b/lib/libc/regex/regerror.c index 9888202..7942ef7 100644 --- a/lib/libc/regex/regerror.c +++ b/lib/libc/regex/regerror.c @@ -81,6 +81,7 @@ static char *regatoi(const regex_t *preg, char *localbuf); = #define REG_EMPTY 14 = #define REG_ASSERT 15 = #define REG_INVARG 16 + = #define REG_ILLSEQ 17 = #define REG_ATOI 255 // convert name to number (!) = #define REG_ITOA 0400 // convert number to name (!) */ @@ -105,6 +106,7 @@ static struct rerr { {REG_EMPTY, "REG_EMPTY", "empty (sub)expression"}, {REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"}, {REG_INVARG, "REG_INVARG", "invalid argument to regex routine"}, + {REG_ILLSEQ, "REG_ILLSEQ", "illegal byte sequence"}, {0, "", "*** unknown regexp error code ***"} }; diff --git a/lib/libc/regex/regex.3 b/lib/libc/regex/regex.3 index d0a9837..11b29a4 100644 --- a/lib/libc/regex/regex.3 +++ b/lib/libc/regex/regex.3 @@ -36,7 +36,7 @@ .\" @(#)regex.3 8.4 (Berkeley) 3/20/94 .\" $FreeBSD$ .\" -.Dd July 6, 2004 +.Dd July 12, 2004 .Dt REGEX 3 .Os .Sh NAME @@ -652,6 +652,8 @@ empty (sub)expression can't happen - you found a bug .It Dv REG_INVARG invalid argument, e.g.\& negative-length string +.It Dv REG_ILLSEQ +illegal byte sequence (bad multibyte character) .El .Sh HISTORY Originally written by |