From 7641c5eab2e15e87eafc318a09f2bd5c6f968607 Mon Sep 17 00:00:00 2001 From: Yuri Pankov Date: Fri, 2 Jun 2017 23:49:01 +0300 Subject: [PATCH] 8354 sync regcomp(3C) with upstream Reviewed by: Robert Mustacchi Approved by: Hans Rosenfeld --- usr/src/lib/libc/amd64/Makefile | 8 +- usr/src/lib/libc/i386/Makefile.com | 8 +- usr/src/lib/libc/port/{locale => regex}/cname.h | 2 +- usr/src/lib/libc/port/{locale => regex}/engine.c | 43 ++++----- usr/src/lib/libc/port/{locale => regex}/regcomp.c | 103 +++++++++++++-------- usr/src/lib/libc/port/{locale => regex}/regerror.c | 8 +- usr/src/lib/libc/port/{locale => regex}/regex2.h | 17 ++-- usr/src/lib/libc/port/{locale => regex}/regexec.c | 13 ++- usr/src/lib/libc/port/{locale => regex}/regfree.c | 2 +- usr/src/lib/libc/port/{locale => regex}/utils.h | 2 +- usr/src/lib/libc/sparc/Makefile.com | 8 +- usr/src/lib/libc/sparcv9/Makefile.com | 20 ++-- 12 files changed, 124 insertions(+), 110 deletions(-) rename usr/src/lib/libc/port/{locale => regex}/cname.h (98%) rename usr/src/lib/libc/port/{locale => regex}/engine.c (96%) rename usr/src/lib/libc/port/{locale => regex}/regcomp.c (94%) rename usr/src/lib/libc/port/{locale => regex}/regerror.c (96%) rename usr/src/lib/libc/port/{locale => regex}/regex2.h (95%) rename usr/src/lib/libc/port/{locale => regex}/regexec.c (94%) rename usr/src/lib/libc/port/{locale => regex}/regfree.c (97%) rename usr/src/lib/libc/port/{locale => regex}/utils.h (97%) diff --git a/usr/src/lib/libc/amd64/Makefile b/usr/src/lib/libc/amd64/Makefile index fedf3fd8f0..e77dd63255 100644 --- a/usr/src/lib/libc/amd64/Makefile +++ b/usr/src/lib/libc/amd64/Makefile @@ -762,10 +762,6 @@ PORTLOCALE= \ nextwctype.o \ nl_langinfo.o \ none.o \ - regcomp.o \ - regfree.o \ - regerror.o \ - regexec.o \ rune.o \ runetype.o \ setlocale.o \ @@ -935,7 +931,11 @@ PORTSYS= \ PORTREGEX= \ glob.o \ regcmp.o \ + regcomp.o \ + regerror.o \ regex.o \ + regexec.o \ + regfree.o \ wordexp.o VALUES= \ diff --git a/usr/src/lib/libc/i386/Makefile.com b/usr/src/lib/libc/i386/Makefile.com index 12e88fc4ae..4d24e7f176 100644 --- a/usr/src/lib/libc/i386/Makefile.com +++ b/usr/src/lib/libc/i386/Makefile.com @@ -808,10 +808,6 @@ PORTLOCALE= \ nextwctype.o \ nl_langinfo.o \ none.o \ - regcomp.o \ - regfree.o \ - regerror.o \ - regexec.o \ rune.o \ runetype.o \ setlocale.o \ @@ -974,7 +970,11 @@ PORTSYS= \ PORTREGEX= \ glob.o \ regcmp.o \ + regcomp.o \ + regerror.o \ regex.o \ + regexec.o \ + regfree.o \ wordexp.o PORTREGEX64= \ diff --git a/usr/src/lib/libc/port/locale/cname.h b/usr/src/lib/libc/port/regex/cname.h similarity index 98% rename from usr/src/lib/libc/port/locale/cname.h rename to usr/src/lib/libc/port/regex/cname.h index 070683a989..4bd065672a 100644 --- a/usr/src/lib/libc/port/locale/cname.h +++ b/usr/src/lib/libc/port/regex/cname.h @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/usr/src/lib/libc/port/locale/engine.c b/usr/src/lib/libc/port/regex/engine.c similarity index 96% rename from usr/src/lib/libc/port/locale/engine.c rename to usr/src/lib/libc/port/regex/engine.c index 8dab65c5b4..7481545864 100644 --- a/usr/src/lib/libc/port/locale/engine.c +++ b/usr/src/lib/libc/port/regex/engine.c @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -148,17 +148,14 @@ static const char *pchar(int ch); * matcher - the actual matching engine */ static int /* 0 success, REG_NOMATCH failure */ -matcher(struct re_guts *g, - const char *string, - size_t nmatch, - regmatch_t pmatch[], - int eflags) +matcher(struct re_guts *g, const char *string, size_t nmatch, + regmatch_t pmatch[], int eflags) { const char *endp; - int i; + size_t i; struct match mv; struct match *m = &mv; - const char *dp; + const char *dp = NULL; const sopno gf = g->firststate+1; /* +1 for OEND */ const sopno gl = g->laststate; const char *start; @@ -249,7 +246,7 @@ matcher(struct re_guts *g, ZAPSTATE(&m->mbs); /* Adjust start according to moffset, to speed things up */ - if (g->moffset > -1) + if (dp != NULL && g->moffset > -1) start = ((dp - g->moffset) < start) ? start : dp - g->moffset; SP("mloop", m->st, *start); @@ -605,8 +602,8 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, break; case OBOL: if ((sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE))) { + (sp > m->offp && sp < m->endp && + *(sp-1) == '\n' && (m->g->cflags®_NEWLINE))) { break; } return (NULL); @@ -618,11 +615,9 @@ backref(struct match *m, const char *start, const char *stop, sopno startst, } return (NULL); case OBOW: - if (((sp == m->beginp && !(m->eflags®_NOTBOL)) || - (sp < m->endp && *(sp-1) == '\n' && - (m->g->cflags®_NEWLINE)) || - (sp > m->beginp && !ISWORD(*(sp-1)))) && - (sp < m->endp && ISWORD(*sp))) { + if (sp < m->endp && ISWORD(*sp) && + ((sp == m->beginp && !(m->eflags®_NOTBOL)) || + (sp > m->offp && !ISWORD(*(sp-1))))) { break; } return (NULL); @@ -775,7 +770,7 @@ fast(struct match *m, const char *start, const char *stop, sopno startst, ASSIGN(fresh, st); SP("start", st, *p); coldp = NULL; - if (start == m->beginp) + if (start == m->offp || (start == m->beginp && !(m->eflags®_NOTBOL))) c = OUT; else { /* @@ -876,7 +871,7 @@ slow(struct match *m, const char *start, const char *stop, sopno startst, SP("sstart", st, *p); st = step(m->g, startst, stopst, st, NOTHING, st); matchp = NULL; - if (start == m->beginp) + if (start == m->offp || (start == m->beginp && !(m->eflags®_NOTBOL))) c = OUT; else { /* @@ -954,11 +949,11 @@ slow(struct match *m, const char *start, const char *stop, sopno startst, */ static states step(struct re_guts *g, - sopno start, /* start state within strip */ - sopno stop, /* state after stop state within strip */ - states bef, /* states reachable before */ - wint_t ch, /* character or NONCHAR code */ - states aft) /* states already known reachable after */ + sopno start, /* start state within strip */ + sopno stop, /* state after stop state within strip */ + states bef, /* states reachable before */ + wint_t ch, /* character or NONCHAR code */ + states aft) /* states already known reachable after */ { cset *cs; sop s; @@ -1073,7 +1068,7 @@ static void print(struct match *m, const char *caption, states st, int ch, FILE *d) { struct re_guts *g = m->g; - int i; + sopno i; int first = 1; if (!(m->eflags®_TRACE)) diff --git a/usr/src/lib/libc/port/locale/regcomp.c b/usr/src/lib/libc/port/regex/regcomp.c similarity index 94% rename from usr/src/lib/libc/port/locale/regcomp.c rename to usr/src/lib/libc/port/regex/regcomp.c index f3027d8a02..c1c1ce90a3 100644 --- a/usr/src/lib/libc/port/locale/regcomp.c +++ b/usr/src/lib/libc/port/regex/regcomp.c @@ -17,7 +17,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -46,22 +46,22 @@ #include #include -#include "runetype.h" -#include "collate.h" +#include "../locale/runetype.h" +#include "../locale/collate.h" #include "utils.h" #include "regex2.h" #include "cname.h" -#include "mblocal.h" +#include "../locale/mblocal.h" /* * parse structure, passed up and down to avoid global variables and * other clumsinesses */ struct parse { - char *next; /* next character in RE */ - char *end; /* end of string (-> NUL normally) */ + const char *next; /* next character in RE */ + const char *end; /* end of string (-> NUL normally) */ int error; /* has an error been seen? */ sop *strip; /* malloced strip */ sopno ssize; /* malloced strip size (allocated) */ @@ -79,10 +79,10 @@ extern "C" { #endif /* === regcomp.c === */ -static void p_ere(struct parse *p, wint_t stop); +static void p_ere(struct parse *p, int stop); static void p_ere_exp(struct parse *p); static void p_str(struct parse *p); -static void p_bre(struct parse *p, wint_t end1, wint_t end2); +static void p_bre(struct parse *p, int end1, int end2); static int p_simp_re(struct parse *p, int starordinary); static int p_count(struct parse *p); static void p_bracket(struct parse *p); @@ -107,7 +107,7 @@ static sopno dupl(struct parse *p, sopno start, sopno finish); static void doemit(struct parse *p, sop op, size_t opnd); static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos); static void dofwd(struct parse *p, sopno pos, sop value); -static void enlarge(struct parse *p, sopno size); +static int enlarge(struct parse *p, sopno size); static void stripsnug(struct parse *p, struct re_guts *g); static void findmust(struct parse *p, struct re_guts *g); static int altoffset(sop *scan, int offset); @@ -164,15 +164,15 @@ static int never = 0; /* for use in asserts; shuts lint up */ * regcomp - interface for parser and compilation */ int /* 0 success, otherwise REG_something */ -regcomp(regex_t *_RESTRICT_KYWD preg, - const char *_RESTRICT_KYWD pattern, - int cflags) +regcomp(regex_t *_RESTRICT_KYWD preg, const char *_RESTRICT_KYWD pattern, + int cflags) { struct parse pa; struct re_guts *g; struct parse *p = &pa; int i; size_t len; + size_t maxlen; #ifdef REDEBUG #define GOODFLAGS(f) (f) #else @@ -189,13 +189,29 @@ regcomp(regex_t *_RESTRICT_KYWD preg, return (REG_EFATAL); len = preg->re_endp - pattern; } else - len = strlen((char *)pattern); + len = strlen(pattern); /* do the mallocs early so failure handling is easy */ g = (struct re_guts *)malloc(sizeof (struct re_guts)); if (g == NULL) return (REG_ESPACE); + /* + * Limit the pattern space to avoid a 32-bit overflow on buffer + * extension. Also avoid any signed overflow in case of conversion + * so make the real limit based on a 31-bit overflow. + * + * Likely not applicable on 64-bit systems but handle the case + * generically (who are we to stop people from using ~715MB+ + * patterns?). + */ + maxlen = ((size_t)-1 >> 1) / sizeof (sop) * 2 / 3; + if (len >= maxlen) { + free((char *)g); + return (REG_ESPACE); + } p->ssize = len/(size_t)2*(size_t)3 + (size_t)1; /* ugh */ + assert(p->ssize >= len); + p->strip = (sop *)malloc(p->ssize * sizeof (sop)); p->slen = 0; if (p->strip == NULL) { @@ -205,7 +221,7 @@ regcomp(regex_t *_RESTRICT_KYWD preg, /* set things up */ p->g = g; - p->next = (char *)pattern; /* convenience; we do not modify it */ + p->next = pattern; /* convenience; we do not modify it */ p->end = p->next + len; p->error = 0; p->ncsalloc = 0; @@ -276,7 +292,7 @@ regcomp(regex_t *_RESTRICT_KYWD preg, */ static void p_ere(struct parse *p, - wint_t stop) /* character this ERE should end at */ + int stop) /* character this ERE should end at */ { char c; sopno prevback; @@ -410,6 +426,8 @@ p_ere_exp(struct parse *p) (void) REQUIRE(!MORE() || !isdigit((uch)PEEK()), REG_BADRPT); /* FALLTHROUGH */ default: + if (p->error != 0) + return; p->next--; wc = WGETNEXT(); ordinary(p, wc); @@ -497,8 +515,8 @@ p_str(struct parse *p) */ static void p_bre(struct parse *p, - wint_t end1, /* first terminating character */ - wint_t end2) /* second terminating character */ + int end1, /* first terminating character */ + int end2) /* second terminating character */ { sopno start = HERE(); int first = 1; /* first subexpression? */ @@ -528,7 +546,7 @@ p_bre(struct parse *p, */ static int /* was the simple RE an unbackslashed $? */ p_simp_re(struct parse *p, - int starordinary) /* is a leading * an ordinary character? */ + int starordinary) /* is a leading * an ordinary character? */ { int c; int count; @@ -539,7 +557,7 @@ p_simp_re(struct parse *p, sopno subno; #define BACKSL (1<error != 0) + return (0); /* Definitely not $... */ p->next--; wc = WGETNEXT(); ordinary(p, wc); @@ -800,7 +820,7 @@ p_b_term(struct parse *p, cset *cs) static void p_b_cclass(struct parse *p, cset *cs) { - char *sp = p->next; + const char *sp = p->next; size_t len; wctype_t wct; char clname[16]; @@ -858,14 +878,13 @@ p_b_symbol(struct parse *p) */ static wint_t /* value of collating element */ p_b_coll_elem(struct parse *p, - wint_t endc) /* name ended by endc,']' */ + wint_t endc) /* name ended by endc,']' */ { - char *sp = p->next; + const char *sp = p->next; struct cname *cp; - int len; mbstate_t mbs; wchar_t wc; - size_t clen; + size_t clen, len; while (MORE() && !SEETWO(endc, ']')) NEXT(); @@ -910,8 +929,8 @@ othercase(wint_t ch) static void bothcases(struct parse *p, wint_t ch) { - char *oldnext = p->next; - char *oldend = p->end; + const char *oldnext = p->next; + const char *oldend = p->end; char bracket[3 + MB_LEN_MAX]; size_t n; mbstate_t mbs; @@ -962,8 +981,8 @@ ordinary(struct parse *p, wint_t ch) static void nonnewline(struct parse *p) { - char *oldnext = p->next; - char *oldend = p->end; + const char *oldnext = p->next; + const char *oldend = p->end; char bracket[4]; p->next = bracket; @@ -1192,7 +1211,7 @@ CHaddrange(struct parse *p, cset *cs, wint_t min, wint_t max) } cs->ranges = newranges; cs->ranges[cs->nranges].min = min; - cs->ranges[cs->nranges].min = max; + cs->ranges[cs->nranges].max = max; cs->nranges++; } @@ -1223,8 +1242,8 @@ CHaddtype(struct parse *p, cset *cs, wctype_t wct) */ static sopno /* start of duplicate */ dupl(struct parse *p, - sopno start, /* from here */ - sopno finish) /* to this less one */ + sopno start, /* from here */ + sopno finish) /* to this less one */ { sopno ret = HERE(); sopno len = finish - start; @@ -1232,7 +1251,8 @@ dupl(struct parse *p, assert(finish >= start); if (len == 0) return (ret); - enlarge(p, p->ssize + len); /* this many unexpected additions */ + if (!enlarge(p, p->ssize + len)) /* this many unexpected additions */ + return (ret); assert(p->ssize >= p->slen + len); (void) memcpy((char *)(p->strip + p->slen), (char *)(p->strip + start), (size_t)len*sizeof (sop)); @@ -1259,8 +1279,8 @@ doemit(struct parse *p, sop op, size_t opnd) /* deal with undersized strip */ if (p->slen >= p->ssize) - enlarge(p, (p->ssize+1) / 2 * 3); /* +50% */ - assert(p->slen < p->ssize); + if (!enlarge(p, (p->ssize+1) / 2 * 3)) /* +50% */ + return; /* finally, it's all reduced to the easy case */ p->strip[p->slen++] = SOP(op, opnd); @@ -1318,21 +1338,22 @@ dofwd(struct parse *p, sopno pos, sop value) /* * enlarge - enlarge the strip */ -static void +static int enlarge(struct parse *p, sopno size) { sop *sp; if (p->ssize >= size) - return; + return (1); sp = (sop *)realloc(p->strip, size*sizeof (sop)); if (sp == NULL) { SETERROR(REG_ESPACE); - return; + return (0); } p->strip = sp; p->ssize = size; + return (1); } /* @@ -1362,8 +1383,8 @@ static void findmust(struct parse *p, struct re_guts *g) { sop *scan; - sop *start; - sop *newstart; + sop *start = NULL; + sop *newstart = NULL; sopno newlen; sop s; char *cp; @@ -1678,8 +1699,10 @@ computematchjumps(struct parse *p, struct re_guts *g) } g->matchjump = (int *)malloc(g->mlen * sizeof (unsigned int)); - if (g->matchjump == NULL) /* Not a fatal error */ + if (g->matchjump == NULL) { /* Not a fatal error */ + free(pmatches); return; + } /* Set maximum possible jump for each character in the pattern */ for (mindex = 0; mindex < g->mlen; mindex++) diff --git a/usr/src/lib/libc/port/locale/regerror.c b/usr/src/lib/libc/port/regex/regerror.c similarity index 96% rename from usr/src/lib/libc/port/locale/regerror.c rename to usr/src/lib/libc/port/regex/regerror.c index 9f7a495bff..3915c4429b 100644 --- a/usr/src/lib/libc/port/locale/regerror.c +++ b/usr/src/lib/libc/port/regex/regerror.c @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -48,8 +48,8 @@ static struct rerr { int code; - char *name; - char *explain; + const char *name; + const char *explain; } rerrs[] = { RERR(REG_NOMATCH, "regexec() failed to match"), RERR(REG_BADPAT, "invalid regular expression"), @@ -90,7 +90,7 @@ regerror(int errcode, const regex_t *_RESTRICT_KYWD preg, { struct rerr *r; size_t len; - char *s; + const char *s; for (r = rerrs; r->code != 0; r++) if (r->code == errcode) diff --git a/usr/src/lib/libc/port/locale/regex2.h b/usr/src/lib/libc/port/regex/regex2.h similarity index 95% rename from usr/src/lib/libc/port/locale/regex2.h rename to usr/src/lib/libc/port/regex/regex2.h index f44e1caeef..551611c610 100644 --- a/usr/src/lib/libc/port/locale/regex2.h +++ b/usr/src/lib/libc/port/regex/regex2.h @@ -14,7 +14,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -29,9 +29,6 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. - * - * @(#)regex2.h 8.4 (Berkeley) 3/20/94 - * $FreeBSD: src/lib/libc/regex/regex2.h,v 1.11 2007/01/09 00:28:04 imp Exp $ */ /* @@ -73,7 +70,7 @@ * immediately *preceding* "execution" of that operator. */ typedef unsigned int sop; /* strip operator */ -typedef int sopno; +typedef unsigned int sopno; #define OPRMASK 0xf8000000U #define OPDMASK 0x07ffffffU #define OPSHIFT ((unsigned)27) @@ -113,11 +110,11 @@ typedef struct { typedef struct { unsigned char bmp[NC / 8]; wctype_t *types; - int ntypes; + unsigned int ntypes; wint_t *wides; - int nwides; + unsigned int nwides; crange *ranges; - int nranges; + unsigned int nranges; int invert; int icase; } cset; @@ -125,7 +122,7 @@ typedef struct { static int CHIN1(cset *cs, wint_t ch) { - int i; + unsigned int i; assert(ch >= 0); if (ch < NC) @@ -165,7 +162,7 @@ struct re_guts { int magic; #define MAGIC2 ((('R'^0200)<<8)|'E') sop *strip; /* malloced area for strip */ - int ncsets; /* number of csets in use */ + unsigned int ncsets; /* number of csets in use */ cset *sets; /* -> cset [ncsets] */ int cflags; /* copy of regcomp() cflags argument */ sopno nstates; /* = number of sops */ diff --git a/usr/src/lib/libc/port/locale/regexec.c b/usr/src/lib/libc/port/regex/regexec.c similarity index 94% rename from usr/src/lib/libc/port/locale/regexec.c rename to usr/src/lib/libc/port/regex/regexec.c index b6b9b6f56c..c1bc7b436a 100644 --- a/usr/src/lib/libc/port/locale/regexec.c +++ b/usr/src/lib/libc/port/regex/regexec.c @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -195,9 +195,8 @@ xmbrtowc_dummy(wint_t *wi, const char *s, size_t n, mbstate_t *mbs, * have been prototyped. */ int /* 0 success, REG_NOMATCH failure */ -regexec(const regex_t *_RESTRICT_KYWD preg, - const char *_RESTRICT_KYWD string, size_t nmatch, - regmatch_t pmatch[_RESTRICT_KYWD], int eflags) +regexec(const regex_t *_RESTRICT_KYWD preg, const char *_RESTRICT_KYWD string, + size_t nmatch, regmatch_t pmatch[_RESTRICT_KYWD], int eflags) { struct re_guts *g = preg->re_g; #ifdef REDEBUG @@ -218,13 +217,13 @@ regexec(const regex_t *_RESTRICT_KYWD preg, eflags = GOODFLAGS(eflags); if (MB_CUR_MAX > 1) - return (mmatcher(g, (char *)string, nmatch, pmatch, eflags)); + return (mmatcher(g, string, nmatch, pmatch, eflags)); #ifdef REG_LARGE else if (g->nstates <= CHAR_BIT*sizeof (states1) && !(eflags®_LARGE)) #else else if (g->nstates <= CHAR_BIT*sizeof (states1)) #endif - return (smatcher(g, (char *)string, nmatch, pmatch, eflags)); + return (smatcher(g, string, nmatch, pmatch, eflags)); else - return (lmatcher(g, (char *)string, nmatch, pmatch, eflags)); + return (lmatcher(g, string, nmatch, pmatch, eflags)); } diff --git a/usr/src/lib/libc/port/locale/regfree.c b/usr/src/lib/libc/port/regex/regfree.c similarity index 97% rename from usr/src/lib/libc/port/locale/regfree.c rename to usr/src/lib/libc/port/regex/regfree.c index 43c7e13958..0e84f0d8cc 100644 --- a/usr/src/lib/libc/port/locale/regfree.c +++ b/usr/src/lib/libc/port/regex/regfree.c @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/usr/src/lib/libc/port/locale/utils.h b/usr/src/lib/libc/port/regex/utils.h similarity index 97% rename from usr/src/lib/libc/port/locale/utils.h rename to usr/src/lib/libc/port/regex/utils.h index 3ed1484391..b77dc69433 100644 --- a/usr/src/lib/libc/port/locale/utils.h +++ b/usr/src/lib/libc/port/regex/utils.h @@ -15,7 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/usr/src/lib/libc/sparc/Makefile.com b/usr/src/lib/libc/sparc/Makefile.com index 2f5f67dd8f..7c8f14372d 100644 --- a/usr/src/lib/libc/sparc/Makefile.com +++ b/usr/src/lib/libc/sparc/Makefile.com @@ -836,10 +836,6 @@ PORTLOCALE= \ nextwctype.o \ nl_langinfo.o \ none.o \ - regcomp.o \ - regfree.o \ - regerror.o \ - regexec.o \ rune.o \ runetype.o \ setlocale.o \ @@ -1002,7 +998,11 @@ PORTSYS= \ PORTREGEX= \ glob.o \ regcmp.o \ + regcomp.o \ + regerror.o \ regex.o \ + regexec.o \ + regfree.o \ wordexp.o PORTREGEX64= \ diff --git a/usr/src/lib/libc/sparcv9/Makefile.com b/usr/src/lib/libc/sparcv9/Makefile.com index a3861c40f0..6744289046 100644 --- a/usr/src/lib/libc/sparcv9/Makefile.com +++ b/usr/src/lib/libc/sparcv9/Makefile.com @@ -39,12 +39,12 @@ TARGET_ARCH= sparc # Symbol capabilities objects. EXTPICS= \ - $(LIBCDIR)/capabilities/sun4u/sparcv9/pics/symcap.o \ - $(LIBCDIR)/capabilities/sun4u-opl/sparcv9/pics/symcap.o \ - $(LIBCDIR)/capabilities/sun4u-us3-hwcap1/sparcv9/pics/symcap.o \ - $(LIBCDIR)/capabilities/sun4u-us3-hwcap2/sparcv9/pics/symcap.o \ - $(LIBCDIR)/capabilities/sun4v-hwcap1/sparcv9/pics/symcap.o \ - $(LIBCDIR)/capabilities/sun4v-hwcap2/sparcv9/pics/symcap.o + $(LIBCDIR)/capabilities/sun4u/sparcv9/pics/symcap.o \ + $(LIBCDIR)/capabilities/sun4u-opl/sparcv9/pics/symcap.o \ + $(LIBCDIR)/capabilities/sun4u-us3-hwcap1/sparcv9/pics/symcap.o \ + $(LIBCDIR)/capabilities/sun4u-us3-hwcap2/sparcv9/pics/symcap.o \ + $(LIBCDIR)/capabilities/sun4v-hwcap1/sparcv9/pics/symcap.o \ + $(LIBCDIR)/capabilities/sun4v-hwcap2/sparcv9/pics/symcap.o # local objects STRETS= @@ -780,10 +780,6 @@ PORTLOCALE= \ nextwctype.o \ nl_langinfo.o \ none.o \ - regcomp.o \ - regfree.o \ - regerror.o \ - regexec.o \ rune.o \ runetype.o \ setlocale.o \ @@ -948,7 +944,11 @@ PORTSYS= \ PORTREGEX= \ glob.o \ regcmp.o \ + regcomp.o \ + regerror.o \ regex.o \ + regexec.o \ + regfree.o \ wordexp.o VALUES= values-Xa.o -- 2.11.4.GIT