aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-13 23:59:52 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-04-13 23:59:52 +0000
commit86b5b2210f0ea0158af81b9da1f6849ea7dcea5d (patch)
treeb7e23fd3c844849d188813323076c93105a57d4d /coreutils
parentb2f7a26679f7d538944f4725e92b512745cff948 (diff)
downloadbusybox-w32-86b5b2210f0ea0158af81b9da1f6849ea7dcea5d.tar.gz
busybox-w32-86b5b2210f0ea0158af81b9da1f6849ea7dcea5d.tar.bz2
busybox-w32-86b5b2210f0ea0158af81b9da1f6849ea7dcea5d.zip
teach find_root_device to deal with /dev/ subdirs
(by "Kirill K. Smirnov" <lich@math.spbu.ru>) git-svn-id: svn://busybox.net/trunk/busybox@18435 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 7bbb19d6c..b9c07adf8 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -504,11 +504,11 @@ static struct dnode **list_dir(const char *path)
504 504
505 /* are we going to list the file- it may be . or .. or a hidden file */ 505 /* are we going to list the file- it may be . or .. or a hidden file */
506 if (entry->d_name[0] == '.') { 506 if (entry->d_name[0] == '.') {
507 if ((entry->d_name[1] == 0 || ( 507 if ((!entry->d_name[1] || (entry->d_name[1] == '.' && !entry->d_name[2]))
508 entry->d_name[1] == '.' 508 && !(all_fmt & DISP_DOT)
509 && entry->d_name[2] == 0)) 509 ) {
510 && !(all_fmt & DISP_DOT))
511 continue; 510 continue;
511 }
512 if (!(all_fmt & DISP_HIDDEN)) 512 if (!(all_fmt & DISP_HIDDEN))
513 continue; 513 continue;
514 } 514 }
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 61e3e7010..e29073db8 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -40,7 +40,7 @@ int rm_main(int argc, char **argv)
40 do { 40 do {
41 const char *base = bb_get_last_path_component(*argv); 41 const char *base = bb_get_last_path_component(*argv);
42 42
43 if ((base[0] == '.') && (!base[1] || ((base[1] == '.') && !base[2]))) { 43 if (DOT_OR_DOTDOT(base)) {
44 bb_error_msg("cannot remove '.' or '..'"); 44 bb_error_msg("cannot remove '.' or '..'");
45 } else if (remove_file(*argv, flags) >= 0) { 45 } else if (remove_file(*argv, flags) >= 0) {
46 continue; 46 continue;