Applied patch from Matt Kraai which does the following:
- adds case-insensitive matching in sed s/// epxressions - consolodates common regcomp code in grep & sed into bb_regcomp and put in utility.c - cleans up a bunch of cruft
This commit is contained in:
16
utility.c
16
utility.c
@@ -1721,6 +1721,22 @@ char *get_last_path_component(char *path)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined BB_GREP || defined BB_SED
|
||||
int bb_regcomp(regex_t *preg, const char *regex, int cflags)
|
||||
{
|
||||
int ret;
|
||||
if ((ret = regcomp(preg, regex, cflags)) != 0) {
|
||||
int errmsgsz = regerror(ret, preg, NULL, 0);
|
||||
char *errmsg = xmalloc(errmsgsz);
|
||||
regerror(ret, preg, errmsg, errmsgsz);
|
||||
errorMsg("bb_regcomp: %s\n", errmsg);
|
||||
free(errmsg);
|
||||
regfree(preg);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* END CODE */
|
||||
/*
|
||||
Local Variables:
|
||||
|
Reference in New Issue
Block a user