summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen2002-04-17 20:21:45 +0000
committerEric Andersen2002-04-17 20:21:45 +0000
commit5f6873621d58e879d06b9a1ef7ea28b6d84c4b43 (patch)
tree8559a9f95f02fe7a50d08b13e6f45671f0aac840 /coreutils
parent272a95524f71c661fc00e9ebd6be3d06d57cf266 (diff)
downloadbusybox-5f6873621d58e879d06b9a1ef7ea28b6d84c4b43.zip
busybox-5f6873621d58e879d06b9a1ef7ea28b6d84c4b43.tar.gz
ls could mis-color certain entries when previous commands
had failed. Explicitly 0 out errno to prevent that.
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index bbc9114..661f9a2 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -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) );
}