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:
6e91f69
)
Fix symlink removal problem noted by Erik Andersen.
author
Matt Kraai
<kraai@debian.org>
Fri, 11 May 2001 02:35:36 +0000
(
02:35
-0000)
committer
Matt Kraai
<kraai@debian.org>
Fri, 11 May 2001 02:35:36 +0000
(
02:35
-0000)
libbb/remove_file.c
patch
|
blob
|
history
diff --git
a/libbb/remove_file.c
b/libbb/remove_file.c
index 52b3211e652eb652eb4c5df2f04d71df8e33890f..23be40429333231f25e986035445ffd9c1935c13 100644
(file)
--- a/
libbb/remove_file.c
+++ b/
libbb/remove_file.c
@@
-37,7
+37,7
@@
extern int remove_file(const char *path, int flags)
struct stat path_stat;
int path_exists = 1;
- if (stat(path, &path_stat) < 0) {
+ if (
l
stat(path, &path_stat) < 0) {
if (errno != ENOENT) {
perror_msg("unable to stat `%s'", path);
return -1;
@@
-110,6
+110,7
@@
extern int remove_file(const char *path, int flags)
return status;
} else {
if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0 &&
+ !S_ISLNK(path_stat.st_mode) &&
isatty(0)) ||
(flags & FILEUTILS_INTERACTIVE)) {
fprintf(stderr, "%s: remove `%s'? ", applet_name, path);