Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
6e1c32e0
提交
6e1c32e0
authored
1月 19, 2008
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@7301
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
798b257b
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
23 行增加
和
14 行删除
+23
-14
switch_regex.c
src/switch_regex.c
+1
-1
switch_utils.c
src/switch_utils.c
+22
-13
没有找到文件。
src/switch_regex.c
浏览文件 @
6e1c32e0
...
@@ -95,7 +95,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
...
@@ -95,7 +95,7 @@ SWITCH_DECLARE(int) switch_regex_perform(const char *field, const char *expressi
&
erroffset
,
/* for error offset */
&
erroffset
,
/* for error offset */
NULL
);
/* use default character tables */
NULL
);
/* use default character tables */
if
(
error
)
{
if
(
error
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"COMPILE ERROR: %d [%s]
\n
"
,
erroffset
,
error
);
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"COMPILE ERROR: %d [%s]
[%s]
\n
"
,
erroffset
,
error
,
expression
);
switch_regex_safe_free
(
re
);
switch_regex_safe_free
(
re
);
goto
end
;
goto
end
;
}
}
...
...
src/switch_utils.c
浏览文件 @
6e1c32e0
...
@@ -35,7 +35,7 @@
...
@@ -35,7 +35,7 @@
#include <arpa/inet.h>
#include <arpa/inet.h>
#endif
#endif
#include "private/switch_core_pvt.h"
#include "private/switch_core_pvt.h"
#define ESCAPE_META '\\'
SWITCH_DECLARE
(
char
*
)
switch_find_end_paren
(
const
char
*
s
,
char
open
,
char
close
)
SWITCH_DECLARE
(
char
*
)
switch_find_end_paren
(
const
char
*
s
,
char
open
,
char
close
)
{
{
...
@@ -1017,7 +1017,7 @@ SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in,
...
@@ -1017,7 +1017,7 @@ SWITCH_DECLARE(char *) switch_escape_char(switch_memory_pool_t *pool, char *in,
static
char
unescape_char
(
char
escaped
)
static
char
unescape_char
(
char
escaped
)
{
{
char
unescaped
;
char
unescaped
;
printf
(
"WTF [%c]
\n
"
,
escaped
);
switch
(
escaped
)
{
switch
(
escaped
)
{
case
'n'
:
case
'n'
:
unescaped
=
'\n'
;
unescaped
=
'\n'
;
...
@@ -1052,16 +1052,25 @@ static char *cleanup_separated_string(char *str)
...
@@ -1052,16 +1052,25 @@ static char *cleanup_separated_string(char *str)
}
}
for
(
start
=
dest
=
ptr
;
*
ptr
;
++
ptr
)
{
for
(
start
=
dest
=
ptr
;
*
ptr
;
++
ptr
)
{
if
(
*
ptr
==
'\\'
)
{
char
e
;
++
ptr
;
int
esc
=
0
;
*
dest
++
=
unescape_char
(
*
ptr
);
end
=
dest
;
if
(
*
ptr
==
ESCAPE_META
)
{
}
else
if
(
*
ptr
==
'\''
)
{
if
((
e
=
unescape_char
(
*
(
ptr
+
1
)))
!=
e
)
{
inside_quotes
=
(
1
-
inside_quotes
);
++
ptr
;
}
else
{
*
dest
++
=
e
;
*
dest
++
=
*
ptr
;
if
(
*
ptr
!=
' '
||
inside_quotes
)
{
end
=
dest
;
end
=
dest
;
esc
++
;
}
}
if
(
!
esc
)
{
if
(
*
ptr
==
'\''
)
{
inside_quotes
=
(
1
-
inside_quotes
);
}
else
{
*
dest
++
=
*
ptr
;
if
(
*
ptr
!=
' '
||
inside_quotes
)
{
end
=
dest
;
}
}
}
}
}
}
}
...
@@ -1093,7 +1102,7 @@ static unsigned int separate_string_char_delim(char *buf, char delim, char **arr
...
@@ -1093,7 +1102,7 @@ static unsigned int separate_string_char_delim(char *buf, char delim, char **arr
case
FIND_DELIM
:
case
FIND_DELIM
:
/* escaped characters are copied verbatim to the destination string */
/* escaped characters are copied verbatim to the destination string */
if
(
*
ptr
==
'\\'
)
{
if
(
*
ptr
==
ESCAPE_META
)
{
++
ptr
;
++
ptr
;
}
else
if
(
*
ptr
==
'\''
)
{
}
else
if
(
*
ptr
==
'\''
)
{
inside_quotes
=
(
1
-
inside_quotes
);
inside_quotes
=
(
1
-
inside_quotes
);
...
@@ -1143,7 +1152,7 @@ static unsigned int separate_string_blank_delim(char *buf, char **array, unsigne
...
@@ -1143,7 +1152,7 @@ static unsigned int separate_string_blank_delim(char *buf, char **array, unsigne
break
;
break
;
case
FIND_DELIM
:
case
FIND_DELIM
:
if
(
*
ptr
==
'\\'
)
{
if
(
*
ptr
==
ESCAPE_META
)
{
++
ptr
;
++
ptr
;
}
else
if
(
*
ptr
==
'\''
)
{
}
else
if
(
*
ptr
==
'\''
)
{
inside_quotes
=
(
1
-
inside_quotes
);
inside_quotes
=
(
1
-
inside_quotes
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论