*/
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 */
#ifdef BB_SH
/* Add in a special case hack -- whenever **argv == '-'
- * (i.e. '-su' or '-sh') always invoke the shell */
+ * (i.e., '-su' or '-sh') always invoke the shell */
if (**argv == '-' && *(*argv+1)!= '-') {
applet_name = "sh";
}
#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);