diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-21 23:33:22 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-11-21 23:33:22 +0000 |
commit | 607ce4f77fe1fcb6792ae0237f551e9bbca23136 (patch) | |
tree | 805a1696bee4f4502fda9bebc28a361b960c6f04 | |
parent | 837188acd3f99b5a97d82e53ceb86fbf35cf2acf (diff) |
Allow space within an extension, when the space is within a character class.
(requested by lmadsen on -dev, patch by me)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@158605 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r-- | main/pbx.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/main/pbx.c b/main/pbx.c index 2621aa1fd..d765b411e 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -7228,18 +7228,19 @@ int ast_async_goto_by_name(const char *channame, const char *context, const char static int ext_strncpy(char *dst, const char *src, int len) { int count = 0; + int insquares = 0; while (*src && (count < len - 1)) { - switch (*src) { - case ' ': - /* otherwise exten => [a-b],1,... doesn't work */ - /* case '-': */ - /* Ignore */ - break; - default: - *dst = *src; - dst++; + if (*src == '[') { + insquares = 1; + } else if (*src == ']') { + insquares = 0; + } else if (*src == ' ' && !insquares) { + src++; + continue; } + *dst = *src; + dst++; src++; count++; } |