aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-02 16:54:41 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-02 16:54:41 +0000
commit18b3c047588ca10e4a897a778a8ddb3ce9434171 (patch)
treeb0f12dfe15b2c62742c22cf40054ba5b607bd2fd
parentcb8ef2fd485f391b2e811c1c01c08ce2c84d27cf (diff)
downloadbusybox-w32-18b3c047588ca10e4a897a778a8ddb3ce9434171.tar.gz
busybox-w32-18b3c047588ca10e4a897a778a8ddb3ce9434171.tar.bz2
busybox-w32-18b3c047588ca10e4a897a778a8ddb3ce9434171.zip
- use xregcomp. Untested. vda, isn't there a regfree missing here?
text data bss dec hex filename 2522 0 0 2522 9da expr.o.r18305 2478 0 0 2478 9ae expr.o git-svn-id: svn://busybox.net/trunk/busybox@18306 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--coreutils/expr.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 8eda36739..8401594b5 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -226,8 +226,7 @@ of a basic regular expression is not portable; it is being ignored", pv->u.s);
226 226
227 memset(&re_buffer, 0, sizeof(re_buffer)); 227 memset(&re_buffer, 0, sizeof(re_buffer));
228 memset(re_regs, 0, sizeof(*re_regs)); 228 memset(re_regs, 0, sizeof(*re_regs));
229 if (regcomp(&re_buffer, pv->u.s, 0) != 0) 229 xregcomp(&re_buffer, pv->u.s, 0);
230 bb_error_msg_and_die("invalid regular expression");
231 230
232 /* expr uses an anchored pattern match, so check that there was a 231 /* expr uses an anchored pattern match, so check that there was a
233 * match and that the match starts at offset 0. */ 232 * match and that the match starts at offset 0. */
@@ -246,6 +245,7 @@ of a basic regular expression is not portable; it is being ignored", pv->u.s);
246 else 245 else
247 v = int_value(0); 246 v = int_value(0);
248 } 247 }
248//FIXME: sounds like here is a bit missing: regfree(&re_buffer);
249 return v; 249 return v;
250} 250}
251 251