static void
-tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **envp)
+tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) const char *cmd, char **argv, char **envp)
{
#if ENABLE_FEATURE_SH_STANDALONE
if (applet_no >= 0) {
#else
execve(cmd, argv, envp);
#endif
- if (cmd != (char*) bb_busybox_exec_path && errno == ENOEXEC) {
+ if (cmd != bb_busybox_exec_path && errno == ENOEXEC) {
/* Run "cmd" as a shell script:
* http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html
* "If the execve() function fails with ENOEXEC, the shell
* message and exit code 126. For one, this prevents attempts
* to interpret foreign ELF binaries as shell scripts.
*/
- argv[0] = cmd;
- cmd = (char*) bb_busybox_exec_path;
+ argv[0] = (char*) cmd;
+ cmd = bb_busybox_exec_path;
/* NB: this is only possible because all callers of shellexec()
* ensure that the argv[-1] slot exists!
*/