]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
filepath: leave off / if bare inode (no relative part)
authorSage Weil <sage@newdream.net>
Thu, 26 Mar 2009 18:49:00 +0000 (11:49 -0700)
committerSage Weil <sage@newdream.net>
Thu, 26 Mar 2009 20:10:11 +0000 (13:10 -0700)
src/include/filepath.h

index 63d2d8e112a12e865bb528e22a0c2b82af93973c..040f1a7f621bb1270cfc7cf574fe4dec77d103f2 100644 (file)
@@ -195,8 +195,11 @@ WRITE_CLASS_ENCODER(filepath)
 
 inline ostream& operator<<(ostream& out, const filepath& path)
 {
-  if (path.get_ino())
-    out << '#' << hex << path.get_ino() << dec << '/';
+  if (path.get_ino()) {
+    out << '#' << hex << path.get_ino() << dec;
+    if (path.depth())
+      out << '/';
+  }
   return out << path.get_path();
 }