Color executables in ls(1).
This commit is contained in:
parent
c407a24863
commit
7651519f96
|
@ -106,9 +106,14 @@ void getentrycolor(const char** pre, const char** post, mode_t mode)
|
||||||
{
|
{
|
||||||
*pre = "";
|
*pre = "";
|
||||||
*post = "";
|
*post = "";
|
||||||
if ( colors && S_ISDIR(mode) )
|
if ( !colors )
|
||||||
|
return;
|
||||||
|
if ( S_ISDIR(mode) )
|
||||||
*pre = "\e[36m",
|
*pre = "\e[36m",
|
||||||
*post = "\e[37m";
|
*post = "\e[37m";
|
||||||
|
else if ( mode & 0111 )
|
||||||
|
*pre = "\e[32m",
|
||||||
|
*post = "\e[37m";
|
||||||
}
|
}
|
||||||
|
|
||||||
int handleentry(const char* path, const char* name)
|
int handleentry(const char* path, const char* name)
|
||||||
|
|
Loading…
Reference in New Issue