diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-04-17 20:21:45 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-04-17 20:21:45 +0000 |
commit | 5f6873621d58e879d06b9a1ef7ea28b6d84c4b43 (patch) | |
tree | 8559a9f95f02fe7a50d08b13e6f45671f0aac840 /coreutils | |
parent | 272a95524f71c661fc00e9ebd6be3d06d57cf266 (diff) | |
download | busybox-w32-5f6873621d58e879d06b9a1ef7ea28b6d84c4b43.tar.gz busybox-w32-5f6873621d58e879d06b9a1ef7ea28b6d84c4b43.tar.bz2 busybox-w32-5f6873621d58e879d06b9a1ef7ea28b6d84c4b43.zip |
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.c | 2 |
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 | } |