In switch_true/switch_false, check switch_is_number(expr) && atoi(expr) instead of just atoi(expr). Fixes a bug when continue_on_fail contains cause codes only (atoi evals the 1st number so it would always be true)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12834 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
ba1a8ec241
commit
68417f4c25
|
@ -121,7 +121,7 @@ SWITCH_DECLARE(switch_size_t) switch_fd_read_line(int fd, char *buf, switch_size
|
||||||
!strcasecmp(expr, "enabled") ||\
|
!strcasecmp(expr, "enabled") ||\
|
||||||
!strcasecmp(expr, "active") ||\
|
!strcasecmp(expr, "active") ||\
|
||||||
!strcasecmp(expr, "allow") ||\
|
!strcasecmp(expr, "allow") ||\
|
||||||
atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE)
|
(switch_is_number(expr) && atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE)
|
||||||
|
|
||||||
#define switch_true_buf(expr)\
|
#define switch_true_buf(expr)\
|
||||||
((( !strcasecmp(expr, "yes") ||\
|
((( !strcasecmp(expr, "yes") ||\
|
||||||
|
@ -130,7 +130,7 @@ atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE)
|
||||||
!strcasecmp(expr, "enabled") ||\
|
!strcasecmp(expr, "enabled") ||\
|
||||||
!strcasecmp(expr, "active") ||\
|
!strcasecmp(expr, "active") ||\
|
||||||
!strcasecmp(expr, "allow") ||\
|
!strcasecmp(expr, "allow") ||\
|
||||||
atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE)
|
(switch_is_number(expr) && atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Evaluate the falsefullness of a string expression
|
\brief Evaluate the falsefullness of a string expression
|
||||||
|
@ -144,7 +144,7 @@ atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE)
|
||||||
!strcasecmp(expr, "disabled") ||\
|
!strcasecmp(expr, "disabled") ||\
|
||||||
!strcasecmp(expr, "inactive") ||\
|
!strcasecmp(expr, "inactive") ||\
|
||||||
!strcasecmp(expr, "disallow") ||\
|
!strcasecmp(expr, "disallow") ||\
|
||||||
!atoi(expr))) ? SWITCH_TRUE : SWITCH_FALSE)
|
!(switch_is_number(expr) && atoi(expr)))) ? SWITCH_TRUE : SWITCH_FALSE)
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|
Loading…
Reference in New Issue