diff options
author | Mark Whitley | 2000-07-11 16:53:56 +0000 |
---|---|---|
committer | Mark Whitley | 2000-07-11 16:53:56 +0000 |
commit | df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6 (patch) | |
tree | 90005f171e95b4fc0eefca5171593ba0b105b3f7 /utility.c | |
parent | da9841efc1e924ab3f645d931ae17c6d4aaf766f (diff) | |
download | busybox-df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6.zip busybox-df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6.tar.gz |
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
Diffstat (limited to 'utility.c')
-rw-r--r-- | utility.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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: |