From: Erick Tryzelaar Date: Wed, 20 Oct 2010 17:46:26 +0000 (-0700) Subject: __dentry_prepend should not always add trailing '/' X-Git-Tag: release-1.4~111 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=6976f10728ca9d46ef98e5af1a471981e63e0e2b;p=systemtap.git __dentry_prepend should not always add trailing '/' --- diff --git a/tapset/dentry.stp b/tapset/dentry.stp index 0ed50ef10..9c89d381b 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)) }