]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: change escaping chars
authorSage Weil <sage@redhat.com>
Tue, 18 Aug 2015 19:33:39 +0000 (15:33 -0400)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:43 +0000 (13:39 -0400)
# is lowest besides space and !, except for " (which would be too
confusing).

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/newstore/NewStore.cc

index f0ac5f99bc81ba18981d6dd909169252c22c9969..9f5adc244e10667c986b317720c9e35e764c7246 100644 (file)
@@ -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)