From 55d1370f2464a817d7e51cedc26cd7ea6ac78814 Mon Sep 17 00:00:00 2001
From: Mike Buland <mike@xagasoft.com>
Date: Tue, 16 Jul 2024 15:50:34 -0700
Subject: Fixed file type display in MyriadFs ls function.

---
 src/tools/myriadfs.cpp | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/tools/myriadfs.cpp b/src/tools/myriadfs.cpp
index 9051779..c6dd416 100644
--- a/src/tools/myriadfs.cpp
+++ b/src/tools/myriadfs.cpp
@@ -122,11 +122,15 @@ int main( int argc, char *argv[] )
                 for( Bu::MyriadFs::Dir::iterator i = lEnt.begin(); i; i++ )
                 {
                     Bu::String sPerm;
-                    sPerm += ((*i).uPerms&Bu::MyriadFs::typeDir)?"d":
-                        ((*i).uPerms&Bu::MyriadFs::typeChrDev)?"c":
-                        ((*i).uPerms&Bu::MyriadFs::typeBlkDev)?"b":
-                        ((*i).uPerms&Bu::MyriadFs::typeSymLink)?"l":
-                        ((*i).uPerms&Bu::MyriadFs::typeSocket)?"s":"-";
+                    switch( (*i).uPerms&Bu::MyriadFs::typeMask )
+                    {
+                        case Bu::MyriadFs::typeDir: sPerm += "d"; break;
+                        case Bu::MyriadFs::typeChrDev: sPerm += "c"; break;
+                        case Bu::MyriadFs::typeBlkDev: sPerm += "b"; break;
+                        case Bu::MyriadFs::typeSymLink: sPerm += "l"; break;
+                        case Bu::MyriadFs::typeSocket: sPerm += "s"; break;
+                        default: sPerm += "-"; break;
+                    }
                     sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrR)?"r":"-";
                     sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrW)?"w":"-";
                     sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrX)?"x":"-";
-- 
cgit v1.2.3