This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2] __dentry_prepend should not always add trailing '/'


---
 tapset/dentry.stp |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tapset/dentry.stp b/tapset/dentry.stp
index 0ed50ef..9c89d38 100644
--- a/tapset/dentry.stp
+++ b/tapset/dentry.stp
@@ -25,7 +25,11 @@ function __dentry_prepend:string(dentry:long,name:string)
         if (dname == "/" && c == "/")
                 return name;
 
-        return sprintf("%s/%s", dname, name);
+        if (name == "") {
+                return dname;
+        } else {
+                return sprintf("%s/%s", dname, name);
+        }
 }
 
 
@@ -115,5 +119,5 @@ function d_path:string(nd:long)
 	    ? @cast(nd,"nameidata")->path->mnt
 	    : @cast(nd,"nameidata")->mnt)
 
-	return task_dentry_path(task_current(), dentry, vfsmnt)
+	return sprintf("%s/", task_dentry_path(task_current(), dentry, vfsmnt))
 }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]