summaryrefslogtreecommitdiffstats
path: root/libmount/src/tab.c
diff options
context:
space:
mode:
authorSøren Holm2014-09-26 18:35:11 +0200
committerKarel Zak2014-10-01 10:01:35 +0200
commit41510d26ddd9a4c83f8589dded539e2985535dcf (patch)
tree5c848b964f9518e965a32c0d7ffff02eb2e0ddb7 /libmount/src/tab.c
parenttextual: there may be no space between option and optional =arg (diff)
downloadkernel-qcow2-util-linux-41510d26ddd9a4c83f8589dded539e2985535dcf.tar.gz
kernel-qcow2-util-linux-41510d26ddd9a4c83f8589dded539e2985535dcf.tar.xz
kernel-qcow2-util-linux-41510d26ddd9a4c83f8589dded539e2985535dcf.zip
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>
Diffstat (limited to 'libmount/src/tab.c')
-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');