aboutsummaryrefslogtreecommitdiff
path: root/coreutils/expr.c
diff options
context:
space:
mode:
authorlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
committerlandley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-08-03 15:41:12 +0000
commit5e2a5391f9142bca773aab4c829615895b69a6b7 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /coreutils/expr.c
parente883e03918a0e26e390ea23996abdb8fc1925f88 (diff)
downloadbusybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2
busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.zip
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.) git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/expr.c')
-rw-r--r--coreutils/expr.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 725196039..0a1baa19d 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -25,14 +25,8 @@
25 25
26/* no getopt needed */ 26/* no getopt needed */
27 27
28#include <stdio.h>
29#include <string.h>
30#include <stdlib.h>
31#include <regex.h>
32#include <sys/types.h>
33#include <errno.h>
34#include "busybox.h" 28#include "busybox.h"
35 29#include "xregex.h"
36 30
37/* The kinds of value we can have. */ 31/* The kinds of value we can have. */
38enum valtype { 32enum valtype {
@@ -116,9 +110,9 @@ static VALUE *str_value (char *s)
116{ 110{
117 VALUE *v; 111 VALUE *v;
118 112
119 v = xmalloc (sizeof(VALUE)); 113 v = xmalloc(sizeof(VALUE));
120 v->type = string; 114 v->type = string;
121 v->u.s = bb_xstrdup (s); 115 v->u.s = xstrdup(s);
122 return v; 116 return v;
123} 117}
124 118
@@ -148,7 +142,7 @@ static int null (VALUE *v)
148static void tostring (VALUE *v) 142static void tostring (VALUE *v)
149{ 143{
150 if (v->type == integer) { 144 if (v->type == integer) {
151 v->u.s = bb_xasprintf ("%" PF_REZ "d", PF_REZ_TYPE v->u.i); 145 v->u.s = xasprintf("%" PF_REZ "d", PF_REZ_TYPE v->u.i);
152 v->type = string; 146 v->type = string;
153 } 147 }
154} 148}
@@ -366,7 +360,7 @@ static VALUE *eval6 (void)
366 else { 360 else {
367 v = xmalloc (sizeof(VALUE)); 361 v = xmalloc (sizeof(VALUE));
368 v->type = string; 362 v->type = string;
369 v->u.s = bb_xstrndup(l->u.s + i1->u.i - 1, i2->u.i); 363 v->u.s = xstrndup(l->u.s + i1->u.i - 1, i2->u.i);
370 } 364 }
371 freev (l); 365 freev (l);
372 freev (i1); 366 freev (i1);