]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
LFNIndex.cc: escape null in append_[un]escaped
authorSamuel Just <sam.just@inktank.com>
Fri, 15 Jun 2012 17:10:47 +0000 (10:10 -0700)
committerSamuel Just <sam.just@inktank.com>
Fri, 15 Jun 2012 17:10:47 +0000 (10:10 -0700)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/os/LFNIndex.cc

index 00a878d5c6003a3dcee8b7cf7b56ab1427855ef1..f73865a93b818e1c928f2367f6b83212e4539aee 100644 (file)
@@ -491,6 +491,8 @@ static void append_escaped(string::const_iterator begin,
       out->append("\\s");
     } else if (*i == '_') {
       out->append("\\u");
+    } else if (*i == '\0') {
+      out->append("\\n");
     } else {
       out->append(i, i+1);
     }
@@ -814,6 +816,8 @@ static bool append_unescaped(string::const_iterator begin,
        out->append("\\");
       else if (*i == 's')
        out->append("/");
+      else if (*i == 'n')
+       out->append('\0');
       else if (*i == 'u')
        out->append("_");
       else