summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenis Vlasenko2007-04-13 23:59:52 +0000
committerDenis Vlasenko2007-04-13 23:59:52 +0000
commit16abcd90aefae8bdb9f7d80a555982dba6ca59b5 (patch)
treeb7e23fd3c844849d188813323076c93105a57d4d /coreutils
parent334fa9bcb50df9a03288be252096750dcec14404 (diff)
downloadbusybox-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.zip
busybox-16abcd90aefae8bdb9f7d80a555982dba6ca59b5.tar.gz
teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>)
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/ls.c8
-rw-r--r--coreutils/rm.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/coreutils/ls.c b/coreutils/ls.c
index 7bbb19d..b9c07ad 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -504,11 +504,11 @@ static struct dnode **list_dir(const char *path)
/* are we going to list the file- it may be . or .. or a hidden file */
if (entry->d_name[0] == '.') {
- if ((entry->d_name[1] == 0 || (
- entry->d_name[1] == '.'
- && entry->d_name[2] == 0))
- && !(all_fmt & DISP_DOT))
+ if ((!entry->d_name[1] || (entry->d_name[1] == '.' && !entry->d_name[2]))
+ && !(all_fmt & DISP_DOT)
+ ) {
continue;
+ }
if (!(all_fmt & DISP_HIDDEN))
continue;
}
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 61e3e70..e29073d 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -40,7 +40,7 @@ int rm_main(int argc, char **argv)
do {
const char *base = bb_get_last_path_component(*argv);
- if ((base[0] == '.') && (!base[1] || ((base[1] == '.') && !base[2]))) {
+ if (DOT_OR_DOTDOT(base)) {
bb_error_msg("cannot remove '.' or '..'");
} else if (remove_file(*argv, flags) >= 0) {
continue;