mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-06-06 13:08:55 +00:00
FS-3205 --resolve
This commit is contained in:
parent
0871b8c53a
commit
05cb400a51
@ -2579,13 +2579,13 @@ SWITCH_DECLARE(int) switch_isxdigit(int c)
|
|||||||
return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char) c] & (_N | _X)));
|
return (c < 0 ? 0 : c > 255 ? 0 : ((_switch_ctype_ + 1)[(unsigned char) c] & (_N | _X)));
|
||||||
}
|
}
|
||||||
static const char *DOW[] = {
|
static const char *DOW[] = {
|
||||||
"sat",
|
|
||||||
"sun",
|
"sun",
|
||||||
"mon",
|
"mon",
|
||||||
"tue",
|
"tue",
|
||||||
"wed",
|
"wed",
|
||||||
"thu",
|
"thu",
|
||||||
"fri"
|
"fri",
|
||||||
|
"sat"
|
||||||
};
|
};
|
||||||
|
|
||||||
SWITCH_DECLARE(const char *) switch_dow_int2str(int val) {
|
SWITCH_DECLARE(const char *) switch_dow_int2str(int val) {
|
||||||
@ -2601,7 +2601,7 @@ SWITCH_DECLARE(int) switch_dow_str2int(const char *exp) {
|
|||||||
|
|
||||||
for (x = 0; x < switch_arraylen(DOW); x++) {
|
for (x = 0; x < switch_arraylen(DOW); x++) {
|
||||||
if (!strncasecmp(DOW[x], exp, 3)) {
|
if (!strncasecmp(DOW[x], exp, 3)) {
|
||||||
ret = x;
|
ret = x + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2611,13 +2611,13 @@ SWITCH_DECLARE(int) switch_dow_str2int(const char *exp) {
|
|||||||
typedef enum {
|
typedef enum {
|
||||||
DOW_ERR = -2,
|
DOW_ERR = -2,
|
||||||
DOW_EOF = -1,
|
DOW_EOF = -1,
|
||||||
DOW_SAT = 0,
|
DOW_SUN = 1,
|
||||||
DOW_SUN,
|
|
||||||
DOW_MON,
|
DOW_MON,
|
||||||
DOW_TUE,
|
DOW_TUE,
|
||||||
DOW_WED,
|
DOW_WED,
|
||||||
DOW_THU,
|
DOW_THU,
|
||||||
DOW_FRI,
|
DOW_FRI,
|
||||||
|
DOW_SAT,
|
||||||
DOW_HYPHEN = '-',
|
DOW_HYPHEN = '-',
|
||||||
DOW_COMA = ','
|
DOW_COMA = ','
|
||||||
} dow_t;
|
} dow_t;
|
||||||
@ -2632,7 +2632,7 @@ static inline dow_t _dow_read_token(const char **s)
|
|||||||
} else if (**s == ',') {
|
} else if (**s == ',') {
|
||||||
(*s)++;
|
(*s)++;
|
||||||
return DOW_COMA;
|
return DOW_COMA;
|
||||||
} else if (**s >= '0' && **s <= '9') {
|
} else if (**s >= '1' && **s <= '7') {
|
||||||
dow_t r = **s - '0';
|
dow_t r = **s - '0';
|
||||||
(*s)++;
|
(*s)++;
|
||||||
return r;
|
return r;
|
||||||
@ -2664,14 +2664,8 @@ SWITCH_DECLARE(switch_bool_t) switch_dow_cmp(const char *exp, int val)
|
|||||||
} else {
|
} else {
|
||||||
/* Valid day found */
|
/* Valid day found */
|
||||||
if (range_start != DOW_EOF) { /* Evaluating a range */
|
if (range_start != DOW_EOF) { /* Evaluating a range */
|
||||||
if (range_start < cur) {
|
if (val >= range_start && val <= cur) {
|
||||||
if (val >= range_start && val <= cur) {
|
return SWITCH_TRUE;
|
||||||
return SWITCH_TRUE;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (val >= cur && val <= range_start) {
|
|
||||||
return SWITCH_TRUE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
range_start = DOW_EOF;
|
range_start = DOW_EOF;
|
||||||
} else if (val == cur) {
|
} else if (val == cur) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user