diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2002-12-03 18:45:21 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2002-12-03 18:45:21 +0000 |
commit | 5f0548192fc4df56e8b21c239f8f75479147e34a (patch) | |
tree | 816b8836046826e4db2213166a96cba0c59aca91 /util | |
parent | 6bf8b68e0ee6596e8b5f0e53656a078bc5e579ba (diff) |
fixes
Diffstat (limited to 'util')
-rw-r--r-- | util/fusermount.c | 17 |
1 files changed, 13 insertions, 4 deletions
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, |