summaryrefslogtreecommitdiff
path: root/encoding
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2015-04-04 18:40:35 +0000
committerJeff Trawick <trawick@apache.org>2015-04-04 18:40:35 +0000
commit33be573bcb76c41ab2c7e2bcba5e177c896c03c2 (patch)
tree0cbf29273a17db66a70395d0d4e78fe3150ed7cc /encoding
parentf1cb0e7a34044ccc86766983af2e40e35037368b (diff)
downloadapr-33be573bcb76c41ab2c7e2bcba5e177c896c03c2.tar.gz
Merge r1642159 from trunk:
Correctly calculate the size of the returned string and set the correct return value in case we actually escape the string. PR: 57230 Submitted by: <aduryagin gmail.com> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1671289 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'encoding')
-rw-r--r--encoding/apr_escape.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/encoding/apr_escape.c b/encoding/apr_escape.c
index eda467593..3be9eb99e 100644
--- a/encoding/apr_escape.c
+++ b/encoding/apr_escape.c
@@ -436,6 +436,8 @@ APR_DECLARE(apr_status_t) apr_escape_path(char *escaped, const char *path,
while ((c = *s) && slen) {
if (TEST_CHAR(c, T_OS_ESCAPE_PATH)) {
d = c2x(c, '%', d);
+ size += 2;
+ found = 1;
}
else {
*d++ = c;