Remove debugging statement.
[oweals/busybox.git] / busybox.c
index badd53d79de9a7c28dc34fbf1c46903d1f96e8b1..7a220f7b04dc96c0c6c3ff864c85b3bb07ac3dff 100644 (file)
--- a/busybox.c
+++ b/busybox.c
@@ -37,10 +37,7 @@ typedef int (*__link_f)(const char *, const char *);
  */
 static char *busybox_fullpath()
 {
-       char proc[256];
-
-       sprintf(proc, "/proc/%d/exe", getpid());
-       return xreadlink(proc);
+       return xreadlink("/proc/self/exe");
 }
 
 /* create (sym)links for each applet */
@@ -77,17 +74,18 @@ int main(int argc, char **argv)
                        applet_name = s;
        }
 
-#ifdef BB_SH
-       /* Add in a special case hack -- whenever **argv == '-'
-        * (i.e. '-su' or '-sh') always invoke the shell */
+       /* Add in a special case hack for a leading hyphen */
        if (**argv == '-' && *(*argv+1)!= '-') {
-               applet_name = "sh";
+               applet_name = (*argv+1);
        }
-#endif
 
-#ifdef BB_LOCALE_SUPPORT
+#ifdef BB_LOCALE_SUPPORT 
+#ifdef BB_INIT
        if(getpid()!=1) /* Do not set locale for `init' */
+#endif
+       {
                setlocale(LC_ALL, "");
+       }
 #endif
 
        run_applet_by_name(applet_name, argc, argv);