From 1a802114affef85791359ca922550018a371dd78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 3 May 2005 02:04:02 +0000 Subject: [PATCH] Got the Visit() return value wrong: "true" means to abort visiting the partitions, because the right entry was found - but we always want to visist all partitions, anyway. Also, if a partition has not been mounted yet, no mount point will be printed. The device string is still missing. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12550 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/bin/mountvolume.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/bin/mountvolume.cpp b/src/bin/mountvolume.cpp index 2f06754d05..4865daaccf 100644 --- a/src/bin/mountvolume.cpp +++ b/src/bin/mountvolume.cpp @@ -163,7 +163,7 @@ struct MountVisitor : public BDiskDeviceVisitor { } } - return true; + return false; } bool silent; @@ -198,17 +198,19 @@ struct PrintPartitionsVisitor : public BDiskDeviceVisitor { { // get name and type const char *name = partition->ContentName(); - if (name == NULL) { + if (name == NULL || name[0] == '\0') { name = partition->Name(); - if (name == NULL) - name = ""; + if (name == NULL || name[0] == '\0') + name = ""; } BPath path; - partition->GetMountPoint(&path); + if (partition->IsMounted()) + partition->GetMountPoint(&path); - printf("%-16s %-20s %s\n", name, partition->ContentType(), path.Path()); - return true; + printf("%-16s %-20s %s\n", + name, partition->ContentType(), partition->IsMounted() ? path.Path() : ""); + return false; } bool listMountablePartitions;