libbb: move nuke_str() from passwd into libbb
[oweals/busybox.git] / libbb / execable.c
index 82241cd81d5823880058d800d941e2a1190cf9c2..178a00a5f1f69a762c7f20e5b2dd852bcf2ae2b0 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Copyright (C) 2006 Gabriel Somlo <somlo at cmu.edu>
  *
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
@@ -68,12 +68,12 @@ int FAST_FUNC exists_execable(const char *filename)
 }
 
 #if ENABLE_FEATURE_PREFER_APPLETS
-/* just like the real execvp, but try to launch an applet named 'file' first
- */
-int FAST_FUNC bb_execvp(const char *file, char *const argv[])
+/* just like the real execvp, but try to launch an applet named 'file' first */
+int FAST_FUNC BB_EXECVP(const char *file, char *const argv[])
 {
-       return execvp(find_applet_by_name(file) >= 0 ? bb_busybox_exec_path : file,
-                                       argv);
+       if (find_applet_by_name(file) >= 0)
+               execvp(bb_busybox_exec_path, argv);
+       return execvp(file, argv);
 }
 #endif