From 5f0548192fc4df56e8b21c239f8f75479147e34a Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 3 Dec 2002 18:45:21 +0000 Subject: fixes --- util/fusermount.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'util/fusermount.c') diff --git a/util/fusermount.c b/util/fusermount.c index ac464d2..b76c819 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -384,10 +384,19 @@ static char *resolve_path(const char *orig, int unmount) { char buf[PATH_MAX]; - /* Resolving at unmount can only be done very carefully, not touching - the mountpoint... So for the moment it's not done. */ - if(unmount) - return strdup(orig); + if(unmount) { + /* Resolving at unmount can only be done very carefully, not touching + the mountpoint... So for the moment it's not done. + + Just remove trailing slashes instead. + */ + char *dst = strdup(orig); + char *end; + for(end = dst + strlen(dst) - 1; end > dst && *end == '/'; end --) + *end = '\0'; + + return dst; + } if(realpath(orig, buf) == NULL) { fprintf(stderr, "%s: Bad mount point %s: %s\n", progname, orig, -- cgit v1.2.3