mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-02-24 02:18:57 +00:00
cleanup
This commit is contained in:
parent
3e11bf0d22
commit
ff2729c370
@ -1922,9 +1922,9 @@ SWITCH_STANDARD_API(cond_function)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!*expr) {
|
if (!*expr) {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
|
|
||||||
if (!switch_isspace(*expr)) {
|
if (!switch_isspace(*expr)) {
|
||||||
goto error;
|
goto error;
|
||||||
@ -1934,65 +1934,62 @@ SWITCH_STANDARD_API(cond_function)
|
|||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
} else {
|
} else {
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (switch_isspace(*expr)) expr++;
|
while (switch_isspace(*expr)) expr++;
|
||||||
|
|
||||||
while (*expr) {
|
switch (*expr) {
|
||||||
switch (*expr) {
|
case '!':
|
||||||
case '!':
|
case '<':
|
||||||
case '<':
|
case '>':
|
||||||
case '>':
|
case '=':
|
||||||
case '=':
|
goto operator;
|
||||||
goto operator;
|
default:
|
||||||
default:
|
goto error;
|
||||||
goto error;
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
operator:
|
operator:
|
||||||
|
|
||||||
switch (*expr) {
|
switch (*expr) {
|
||||||
case '!':
|
case '!':
|
||||||
|
*expr++ = '\0';
|
||||||
|
if (*expr == '=') {
|
||||||
|
o = O_NE;
|
||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
if (*expr == '=') {
|
}
|
||||||
o = O_NE;
|
break;
|
||||||
*expr++ = '\0';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '>':
|
case '>':
|
||||||
|
*expr++ = '\0';
|
||||||
|
if (*expr == '=') {
|
||||||
|
o = O_GE;
|
||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
if (*expr == '=') {
|
} else {
|
||||||
o = O_GE;
|
o = O_GT;
|
||||||
*expr++ = '\0';
|
}
|
||||||
} else {
|
break;
|
||||||
o = O_GT;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '<':
|
case '<':
|
||||||
|
*expr++ = '\0';
|
||||||
|
if (*expr == '=') {
|
||||||
|
o = O_LE;
|
||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
if (*expr == '=') {
|
} else {
|
||||||
o = O_LE;
|
o = O_LT;
|
||||||
*expr++ = '\0';
|
}
|
||||||
} else {
|
break;
|
||||||
o = O_LT;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case '=':
|
case '=':
|
||||||
|
*expr++ = '\0';
|
||||||
|
if (*expr == '=') {
|
||||||
|
o = O_EQ;
|
||||||
*expr++ = '\0';
|
*expr++ = '\0';
|
||||||
if (*expr == '=') {
|
}
|
||||||
o = O_EQ;
|
break;
|
||||||
*expr++ = '\0';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (o) {
|
if (o) {
|
||||||
@ -2052,34 +2049,34 @@ operator:
|
|||||||
b_f = b_is_num ? atof(s_b) : (float) strlen(s_b);
|
b_f = b_is_num ? atof(s_b) : (float) strlen(s_b);
|
||||||
|
|
||||||
switch (o) {
|
switch (o) {
|
||||||
case O_EQ:
|
case O_EQ:
|
||||||
if (!a_is_num && !b_is_num) {
|
if (!a_is_num && !b_is_num) {
|
||||||
is_true = !strcmp(s_a, s_b);
|
is_true = !strcmp(s_a, s_b);
|
||||||
} else {
|
} else {
|
||||||
is_true = a_f == b_f;
|
is_true = a_f == b_f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_NE:
|
case O_NE:
|
||||||
if (!a_is_num && !b_is_num) {
|
if (!a_is_num && !b_is_num) {
|
||||||
is_true = strcmp(s_a, s_b);
|
is_true = strcmp(s_a, s_b);
|
||||||
} else {
|
} else {
|
||||||
is_true = a_f != b_f;
|
is_true = a_f != b_f;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case O_GT:
|
case O_GT:
|
||||||
is_true = a_f > b_f;
|
is_true = a_f > b_f;
|
||||||
break;
|
break;
|
||||||
case O_GE:
|
case O_GE:
|
||||||
is_true = a_f >= b_f;
|
is_true = a_f >= b_f;
|
||||||
break;
|
break;
|
||||||
case O_LT:
|
case O_LT:
|
||||||
is_true = a_f < b_f;
|
is_true = a_f < b_f;
|
||||||
break;
|
break;
|
||||||
case O_LE:
|
case O_LE:
|
||||||
is_true = a_f <= b_f;
|
is_true = a_f <= b_f;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((argc == 2 && !is_true)) {
|
if ((argc == 2 && !is_true)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user