aboutsummaryrefslogtreecommitdiff
path: root/coreutils/ls.c
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-04-17 20:21:45 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2002-04-17 20:21:45 +0000
commit12788adb64bca814a45c0e4443db76d653244ab4 (patch)
tree8559a9f95f02fe7a50d08b13e6f45671f0aac840 /coreutils/ls.c
parent5145f8d4097340cf5fbfa2aa4f72001f6d527da2 (diff)
downloadbusybox-w32-12788adb64bca814a45c0e4443db76d653244ab4.tar.gz
busybox-w32-12788adb64bca814a45c0e4443db76d653244ab4.tar.bz2
busybox-w32-12788adb64bca814a45c0e4443db76d653244ab4.zip
ls could mis-color certain entries when previous commands
had failed. Explicitly 0 out errno to prevent that. git-svn-id: svn://busybox.net/trunk/busybox@4641 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to '')
-rw-r--r--coreutils/ls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index bbc9114d2..661f9a286 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -716,6 +716,7 @@ static int list_single(struct dnode *dn)
716#endif 716#endif
717 case LIST_FILENAME: 717 case LIST_FILENAME:
718#ifdef CONFIG_FEATURE_LS_COLOR 718#ifdef CONFIG_FEATURE_LS_COLOR
719 errno = 0;
719 if (show_color && !lstat(dn->fullname, &info)) { 720 if (show_color && !lstat(dn->fullname, &info)) {
720 printf( "\033[%d;%dm", bgcolor(info.st_mode), 721 printf( "\033[%d;%dm", bgcolor(info.st_mode),
721 fgcolor(info.st_mode) ); 722 fgcolor(info.st_mode) );
@@ -741,6 +742,7 @@ static int list_single(struct dnode *dn)
741#endif 742#endif
742#ifdef CONFIG_FEATURE_LS_COLOR 743#ifdef CONFIG_FEATURE_LS_COLOR
743 if (show_color) { 744 if (show_color) {
745 errno = 0;
744 printf( "\033[%d;%dm", bgcolor(info.st_mode), 746 printf( "\033[%d;%dm", bgcolor(info.st_mode),
745 fgcolor(info.st_mode) ); 747 fgcolor(info.st_mode) );
746 } 748 }