[git commit master 1/1] mount: strip multiple trailing slashes, not just one

Denys Vlasenko vda.linux at googlemail.com
Mon Feb 28 10:09:49 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=c6450c974f4ff8520113d727d58fa74f474cd913
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 util-linux/mount.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util-linux/mount.c b/util-linux/mount.c
index 0127f19..989e5d1 100644
--- a/util-linux/mount.c
+++ b/util-linux/mount.c
@@ -565,7 +565,7 @@ static int mount_it_now(struct mntent *mp, long vfsflags, char *filteropts)
 		// Remove trailing / (if any) from directory we mounted on
 		i = strlen(mp->mnt_dir) - 1;
 		while (i > 0 && mp->mnt_dir[i] == '/')
-			mp->mnt_dir[i] = '\0';
+			mp->mnt_dir[i--] = '\0';
 
 		// Convert to canonical pathnames as needed
 		mp->mnt_dir = bb_simplify_path(mp->mnt_dir);
-- 
1.7.3.4



More information about the busybox-cvs mailing list