summaryrefslogtreecommitdiff
path: root/utility.c
diff options
context:
space:
mode:
authorMark Whitley <markw@lineo.com>2000-07-11 16:53:56 +0000
committerMark Whitley <markw@lineo.com>2000-07-11 16:53:56 +0000
commitdf5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6 (patch)
tree90005f171e95b4fc0eefca5171593ba0b105b3f7 /utility.c
parentda9841efc1e924ab3f645d931ae17c6d4aaf766f (diff)
downloadbusybox-w32-df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6.tar.gz
busybox-w32-df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6.tar.bz2
busybox-w32-df5f6ba1159f8c1af500fa1b8eb9c9646e4de2a6.zip
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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/utility.c b/utility.c
index 46907e46a..cbbc02f98 100644
--- a/utility.c
+++ b/utility.c
@@ -1721,6 +1721,22 @@ char *get_last_path_component(char *path)
1721} 1721}
1722#endif 1722#endif
1723 1723
1724#if defined BB_GREP || defined BB_SED
1725int bb_regcomp(regex_t *preg, const char *regex, int cflags)
1726{
1727 int ret;
1728 if ((ret = regcomp(preg, regex, cflags)) != 0) {
1729 int errmsgsz = regerror(ret, preg, NULL, 0);
1730 char *errmsg = xmalloc(errmsgsz);
1731 regerror(ret, preg, errmsg, errmsgsz);
1732 errorMsg("bb_regcomp: %s\n", errmsg);
1733 free(errmsg);
1734 regfree(preg);
1735 }
1736 return ret;
1737}
1738#endif
1739
1724/* END CODE */ 1740/* END CODE */
1725/* 1741/*
1726Local Variables: 1742Local Variables: