From: Sage Weil Date: Tue, 18 Aug 2015 19:33:39 +0000 (-0400) Subject: os/newstore: change escaping chars X-Git-Tag: v9.1.0~242^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=094a190fd75b0bf9ec53b06da9b752dcd95c7e33;p=ceph.git os/newstore: change escaping chars # is lowest besides space and !, except for " (which would be too confusing). Signed-off-by: Sage Weil --- diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index f0ac5f99bc81..9f5adc244e10 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -91,10 +91,10 @@ static void append_escaped(const string &in, string *out) { char hexbyte[8]; for (string::const_iterator i = in.begin(); i != in.end(); ++i) { - if (*i <= '%') { - snprintf(hexbyte, sizeof(hexbyte), "%%%02x", (unsigned)*i); + if (*i <= '#') { + snprintf(hexbyte, sizeof(hexbyte), "#%02x", (unsigned)*i); out->append(hexbyte); - } else if (*i >= 126) { + } else if (*i >= '~') { snprintf(hexbyte, sizeof(hexbyte), "~%02x", (unsigned)*i); out->append(hexbyte); } else { @@ -107,7 +107,7 @@ static int decode_escaped(const char *p, string *out) { const char *orig_p = p; while (*p && *p != '!') { - if (*p == '%' || *p == '~') { + if (*p == '#' || *p == '~') { unsigned hex; int r = sscanf(++p, "%2x", &hex); if (r < 1)