summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Holm <sgh@sgh.dk>2014-09-26 18:35:11 +0200
committerKarel Zak <kzak@redhat.com>2014-10-24 10:23:57 +0200
commit72746f25adb697499ead20241404c348b6c1072f (patch)
tree88af0bf7614de2c2a834c0c26c46707a773fcce0
parente2816a1ae0a77448af8cb2e5e5365ba984351881 (diff)
downloadutil-linux-72746f25adb697499ead20241404c348b6c1072f.tar.gz
libmount: don't return root if path contains // or ending /
If the path fx. is /foo/bar/ the initial stripoff will replace the last slash with \0 and return a pointer to that exact \0 character. The same thing will happen if the path contains // somewhere. Signed-off-by: Søren Holm <sgh@sgh.dk>
-rw-r--r--libmount/src/tab.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmount/src/tab.c b/libmount/src/tab.c
index 011ba5429..2b0a34371 100644
--- a/libmount/src/tab.c
+++ b/libmount/src/tab.c
@@ -864,7 +864,7 @@ struct libmnt_fs *mnt_table_find_mountpoint(struct libmnt_table *tb,
}
p = stripoff_last_component(mnt);
- if (!p || !*p)
+ if (!p)
break;
} while (mnt && *(mnt + 1) != '\0');