From 6976f10728ca9d46ef98e5af1a471981e63e0e2b Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Wed, 20 Oct 2010 10:46:26 -0700 Subject: [PATCH] __dentry_prepend should not always add trailing '/' --- tapset/dentry.stp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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)) } -- 2.43.5