- don't free user-supplied string (via -e)
[oweals/busybox.git] / libbb / remove_file.c
index 3aaaef8c7f0210f594e5630723b70c9a059ec64c..8b14f07c936f4b1ca96ee2dfbbc826bca64343d8 100644 (file)
@@ -9,7 +9,9 @@
 
 #include "libbb.h"
 
-int remove_file(const char *path, int flags)
+/* Used from NOFORK applets. Must not allocate anything */
+
+int FAST_FUNC remove_file(const char *path, int flags)
 {
        struct stat path_stat;
 
@@ -80,8 +82,10 @@ int remove_file(const char *path, int flags)
        }
 
        /* !ISDIR */
-       if ((!(flags & FILEUTILS_FORCE) && access(path, W_OK) < 0
-                       && !S_ISLNK(path_stat.st_mode) && isatty(0))
+       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);