summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-11-21 23:33:22 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-11-21 23:33:22 +0000
commit35213dff9805362fee78beae5591641913435f48 (patch)
tree805a1696bee4f4502fda9bebc28a361b960c6f04 /main
parent7bd6f1744b15679278ea73df70b95a4d3083270d (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: https://origsvn.digium.com/svn/asterisk/trunk@158605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main')
-rw-r--r--main/pbx.c19
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++;
}