update main #1

Merged
Sinipelto merged 240 commits from Bananymous/banan-os:main into main 2023-11-20 13:20:51 +02:00
1 changed files with 11 additions and 0 deletions
Showing only changes of commit 6e3f176457 - Show all commits

View File

@ -74,7 +74,18 @@ void list_directory(const char* path)
} }
if (list) if (list)
{
printf("%s %4d %4d %6d %s%s\e[m", mode_string(st.st_mode), st.st_uid, st.st_gid, st.st_size, color_string(st.st_mode), dirent->d_name); printf("%s %4d %4d %6d %s%s\e[m", mode_string(st.st_mode), st.st_uid, st.st_gid, st.st_size, color_string(st.st_mode), dirent->d_name);
if (S_ISLNK(st.st_mode))
{
char link_buffer[128];
ssize_t ret = readlinkat(dirfd(dirp), dirent->d_name, link_buffer, sizeof(link_buffer));
if (ret >= 0)
printf(" -> %.*s", ret, link_buffer);
else
perror("readlink");
}
}
else else
printf("%s%s\e[m", color_string(st.st_mode), dirent->d_name); printf("%s%s\e[m", color_string(st.st_mode), dirent->d_name);