projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cff3fe3
)
Only remove directories when removing recursively.
author
Matt Kraai
<kraai@debian.org>
Wed, 20 Sep 2000 23:10:21 +0000
(23:10 -0000)
committer
Matt Kraai
<kraai@debian.org>
Wed, 20 Sep 2000 23:10:21 +0000
(23:10 -0000)
coreutils/rm.c
patch
|
blob
|
history
rm.c
patch
|
blob
|
history
diff --git
a/coreutils/rm.c
b/coreutils/rm.c
index 275c059463487ff73175faabff4a9a46cc594706..c93a94ce10b87a5ad021ac2437049571af556119 100644
(file)
--- a/
coreutils/rm.c
+++ b/
coreutils/rm.c
@@
-45,6
+45,11
@@
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
{
+ if (recursiveFlag == FALSE) {
+ errno = EISDIR;
+ perror(fileName);
+ return (FALSE);
+ }
if (rmdir(fileName) < 0) {
perror(fileName);
return (FALSE);
diff --git
a/rm.c
b/rm.c
index 275c059463487ff73175faabff4a9a46cc594706..c93a94ce10b87a5ad021ac2437049571af556119 100644
(file)
--- a/
rm.c
+++ b/
rm.c
@@
-45,6
+45,11
@@
static int fileAction(const char *fileName, struct stat *statbuf, void* junk)
static int dirAction(const char *fileName, struct stat *statbuf, void* junk)
{
+ if (recursiveFlag == FALSE) {
+ errno = EISDIR;
+ perror(fileName);
+ return (FALSE);
+ }
if (rmdir(fileName) < 0) {
perror(fileName);
return (FALSE);