← Commit list

5f6873621

Eric Andersen
Eric Andersen
2002-04-17
FAILED Duration: 5s

Subject

ls could mis-color certain entries when previous commands had failed. Explicitly 0 out errno to prevent that.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

coreutils/ls.c+2 -0
@@ -716,6 +716,7 @@ static int list_single(struct dnode *dn)
#endif
case LIST_FILENAME:
#ifdef CONFIG_FEATURE_LS_COLOR
+ errno = 0;
if (show_color && !lstat(dn->fullname, &info)) {
printf( "\033[%d;%dm", bgcolor(info.st_mode),
fgcolor(info.st_mode) );
@@ -741,6 +742,7 @@ static int list_single(struct dnode *dn)
#endif
#ifdef CONFIG_FEATURE_LS_COLOR
if (show_color) {
+ errno = 0;
printf( "\033[%d;%dm", bgcolor(info.st_mode),
fgcolor(info.st_mode) );
}