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
1 changed files with 6 additions and 1 deletions

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)