- if ( additional_args )
- args = (const char **) xmalloc (sizeof (char *) * ( 4 + additional_args_cnt ));
- else
- args = (const char **) xmalloc (sizeof (char *) * 4 );
-
- args [0] = get_last_path_component ( xstrdup ( shell ));
-
- if ( loginshell ) {
- char *args0 = xmalloc ( xstrlen ( args [0] ) + 2 );
- args0 [0] = '-';
- strcpy ( args0 + 1, args [0] );
- args [0] = args0;
- }
-
- if ( command ) {
- args [argno++] = "-c";
- args [argno++] = command;
+ args = xmalloc(sizeof(char*) * (4 + additional_args_cnt));
+
+ args[0] = bb_get_last_path_component(xstrdup(shell));
+
+ if (loginshell)
+ args[0] = xasprintf("-%s", args[0]);
+
+ if (command) {
+ args[argno++] = "-c";
+ args[argno++] = command;