1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Color executables in ls(1).

This commit is contained in:
Jonas 'Sortie' Termansen 2013-11-17 14:07:42 +01:00
parent c407a24863
commit 7651519f96

View file

@ -106,9 +106,14 @@ void getentrycolor(const char** pre, const char** post, mode_t mode)
{
*pre = "";
*post = "";
if ( colors && S_ISDIR(mode) )
if ( !colors )
return;
if ( S_ISDIR(mode) )
*pre = "\e[36m",
*post = "\e[37m";
else if ( mode & 0111 )
*pre = "\e[32m",
*post = "\e[37m";
}
int handleentry(const char* path, const char* name)