aboutsummaryrefslogtreecommitdiff
path: root/shell/math.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 14:09:23 +1000
committerNguyễn Thái Ngọc Duy <pclouds@gmail.com>2010-09-14 14:09:23 +1000
commitee7c9b2c212fc7db80cce945e094fc2601092283 (patch)
tree24e51b27dbc3e9ab0b00c5839a6822604c02187c /shell/math.c
parentf28d4b20905b5b1f52ffa52060a0c6caf4b055ba (diff)
parent99862cbfad9c36b4f8f4378c3a7a9f077c239f20 (diff)
downloadbusybox-w32-ee7c9b2c212fc7db80cce945e094fc2601092283.tar.gz
busybox-w32-ee7c9b2c212fc7db80cce945e094fc2601092283.tar.bz2
busybox-w32-ee7c9b2c212fc7db80cce945e094fc2601092283.zip
Merge remote branch 'origin/master'
Diffstat (limited to 'shell/math.c')
-rw-r--r--shell/math.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/shell/math.c b/shell/math.c
index f0cc2e35d..a4c55a4d0 100644
--- a/shell/math.c
+++ b/shell/math.c
@@ -122,7 +122,7 @@
122#define a_e_h_t arith_eval_hooks_t 122#define a_e_h_t arith_eval_hooks_t
123#define lookupvar (math_hooks->lookupvar) 123#define lookupvar (math_hooks->lookupvar)
124#define setvar (math_hooks->setvar ) 124#define setvar (math_hooks->setvar )
125#define endofname (math_hooks->endofname) 125//#define endofname (math_hooks->endofname)
126 126
127#define arith_isspace(arithval) \ 127#define arith_isspace(arithval) \
128 (arithval == ' ' || arithval == '\n' || arithval == '\t') 128 (arithval == ' ' || arithval == '\n' || arithval == '\t')
@@ -479,6 +479,18 @@ static const char op_tokens[] ALIGN1 = {
479/* ptr to ")" */ 479/* ptr to ")" */
480#define endexpression (&op_tokens[sizeof(op_tokens)-7]) 480#define endexpression (&op_tokens[sizeof(op_tokens)-7])
481 481
482const char* FAST_FUNC
483endofname(const char *name)
484{
485 if (!is_name(*name))
486 return name;
487 while (*++name) {
488 if (!is_in_name(*name))
489 break;
490 }
491 return name;
492}
493
482arith_t 494arith_t
483arith(const char *expr, int *perrcode, a_e_h_t *math_hooks) 495arith(const char *expr, int *perrcode, a_e_h_t *math_hooks)
484{ 496{