Minor fix in initrd ls

This commit is contained in:
xamidev
2024-09-23 15:30:20 +02:00
parent 8bac95890a
commit 7071b4788b
2 changed files with 16 additions and 4 deletions

View File

@@ -1,8 +1,8 @@
![BlankOSshowcase](https://github.com/user-attachments/assets/63aae4ae-1633-4981-875d-8e2627ccc25c)
> [!WARNING]
> The project is currently paused, after months of work around the subject. I've had enough for now, and I'll surely come back in some time to implement the more advanced stuff I had planned. For now, enjoy the latest alpha version.
> This is a hobbyist operating system, and it comes without any warranty whatsoever! See the license for more info. Feedback and contributions are highly appreciated.
> This is free and unencumbered software released into the public domain. Many things might be (are) broken.
> The project is a hobbyist operating system, and it comes without any warranty whatsoever! See the license for more info. Feedback and contributions are highly appreciated.
# BlankOS

View File

@@ -80,9 +80,21 @@ void ls_initrd(uint8_t* initrd, int verbose)
{
if (!verbose)
{
printf("%s\n", header->filename);
if (header->typeflag == '5')
{
colorprintf(cyan, black, "%s\n", header->filename);
} else {
printf("%s\n", header->filename);
}
} else {
printf("%7d\t%c\t %s\n", (int)header->size, header->typeflag, header->filename);
if (header->typeflag == '5')
{
printf("%7d\t%c\t", (int)header->size, header->typeflag);
colorprintf(cyan, black, " %s\n", header->filename);
} else {
printf("%7d\t%c\t %s\n", (int)header->size, header->typeflag, header->filename);
}
}
uint32_t size = tar_parse_size(header->size);