btrfs-progs: Do not add extra slash if given path end with it
authorGu Jinxiang <gujx@cn.fujitsu.com>
Thu, 29 Mar 2018 09:11:19 +0000 (17:11 +0800)
committerDavid Sterba <dsterba@suse.com>
Tue, 24 Apr 2018 11:00:11 +0000 (13:00 +0200)
commita5ef445f05fb077736d47624e31b9f6c7bbb0f1b
tree4ab3c904048b651b665887440392116028b1dce6
parent5f53c23e7676e9fafb78fa166e3f00e143b5a2c5
btrfs-progs: Do not add extra slash if given path end with it

When use a given path end with a slash like below,
the output of path will have double slash.

Do not add extra slash if there is already one in the given
path.

$ btrfs filesystem du ./test/
output:
Total   Exclusive  Set shared  Filename
0.00B       0.00B           -  /home/gujx/device/tmp/test//foo

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-du.c