fix disable color on single column output

This commit is contained in:
Murphy 2023-04-30 02:18:47 -04:00
parent 49f7c2be36
commit 191bf86ef2

View file

@ -261,7 +261,7 @@ static void list_files(struct FileInfo* files, int file_len, struct FileListInfo
putchar('\n'); putchar('\n');
} }
} else if (flags->one_column) { } else if (flags->one_column) {
printf("%s%s%s\n", color, finfo.name, flags->colored != NO ? "\x1b[0m" : ""); printf("%s%s%s\n", flags->colored != NO ? color : "", finfo.name, flags->colored != NO ? "\x1b[0m" : "");
} else { } else {
if (info.total_len > w.ws_col) { if (info.total_len > w.ws_col) {
if (i != 0 && i % row_count == 0) putchar('\n'); if (i != 0 && i % row_count == 0) putchar('\n');