aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2024-07-16 15:50:34 -0700
committerMike Buland <mike@xagasoft.com>2024-07-16 15:50:34 -0700
commit55d1370f2464a817d7e51cedc26cd7ea6ac78814 (patch)
tree585ef7ece1d6d986ab5aa9426e35adbdd8bc9615
parent499cdaf05204a40d86e0e1b4dd32709b3ab67e20 (diff)
downloadlibbu++-55d1370f2464a817d7e51cedc26cd7ea6ac78814.tar.gz
libbu++-55d1370f2464a817d7e51cedc26cd7ea6ac78814.tar.bz2
libbu++-55d1370f2464a817d7e51cedc26cd7ea6ac78814.tar.xz
libbu++-55d1370f2464a817d7e51cedc26cd7ea6ac78814.zip
Fixed file type display in MyriadFs ls function.
-rw-r--r--src/tools/myriadfs.cpp14
1 files 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[] )
122 for( Bu::MyriadFs::Dir::iterator i = lEnt.begin(); i; i++ ) 122 for( Bu::MyriadFs::Dir::iterator i = lEnt.begin(); i; i++ )
123 { 123 {
124 Bu::String sPerm; 124 Bu::String sPerm;
125 sPerm += ((*i).uPerms&Bu::MyriadFs::typeDir)?"d": 125 switch( (*i).uPerms&Bu::MyriadFs::typeMask )
126 ((*i).uPerms&Bu::MyriadFs::typeChrDev)?"c": 126 {
127 ((*i).uPerms&Bu::MyriadFs::typeBlkDev)?"b": 127 case Bu::MyriadFs::typeDir: sPerm += "d"; break;
128 ((*i).uPerms&Bu::MyriadFs::typeSymLink)?"l": 128 case Bu::MyriadFs::typeChrDev: sPerm += "c"; break;
129 ((*i).uPerms&Bu::MyriadFs::typeSocket)?"s":"-"; 129 case Bu::MyriadFs::typeBlkDev: sPerm += "b"; break;
130 case Bu::MyriadFs::typeSymLink: sPerm += "l"; break;
131 case Bu::MyriadFs::typeSocket: sPerm += "s"; break;
132 default: sPerm += "-"; break;
133 }
130 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrR)?"r":"-"; 134 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrR)?"r":"-";
131 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrW)?"w":"-"; 135 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrW)?"w":"-";
132 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrX)?"x":"-"; 136 sPerm += ((*i).uPerms&Bu::MyriadFs::permUsrX)?"x":"-";