浏览代码

Fix special character escape

tags/1.0
Timo Röhling 13 年前
父节点
当前提交
5d26960180
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      postsrsd.c

+ 2
- 2
postsrsd.c 查看文件

125
   char *output = buf;
125
   char *output = buf;
126
   if (!input || !output || len == 0) return NULL;
126
   if (!input || !output || len == 0) return NULL;
127
   while (*input && --len) {
127
   while (*input && --len) {
128
-    if (isspace(*input)) {
128
+    if (!isascii(*input) || !isgraph(*input) || *input == '%') {
129
       if (len <= 2) break;
129
       if (len <= 2) break;
130
       *output++ = '%';
130
       *output++ = '%';
131
-      char2hex(*input, output);
131
+      char2hex(*input++, output);
132
       output += 2; len -= 2;
132
       output += 2; len -= 2;
133
     } else {
133
     } else {
134
       *output++ = *input++;
134
       *output++ = *input++;

正在加载...
取消
保存