diff --git a/Userland/Utilities/ls.cpp b/Userland/Utilities/ls.cpp index 2e267cefd44..281650c26c9 100644 --- a/Userland/Utilities/ls.cpp +++ b/Userland/Utilities/ls.cpp @@ -365,10 +365,14 @@ static bool print_filesystem_object(ByteString const& path, ByteString const& na printf("%c%c%c%c%c%c%c%c", st.st_mode & S_IRUSR ? 'r' : '-', st.st_mode & S_IWUSR ? 'w' : '-', - st.st_mode & S_ISUID ? 's' : (st.st_mode & S_IXUSR ? 'x' : '-'), + st.st_mode & S_ISUID + ? (st.st_mode & S_IXUSR ? 's' : 'S') + : (st.st_mode & S_IXUSR ? 'x' : '-'), st.st_mode & S_IRGRP ? 'r' : '-', st.st_mode & S_IWGRP ? 'w' : '-', - st.st_mode & S_ISGID ? 's' : (st.st_mode & S_IXGRP ? 'x' : '-'), + st.st_mode & S_ISGID + ? (st.st_mode & S_IXGRP ? 's' : 'S') + : (st.st_mode & S_IXGRP ? 'x' : '-'), st.st_mode & S_IROTH ? 'r' : '-', st.st_mode & S_IWOTH ? 'w' : '-');