aboutsummaryrefslogtreecommitdiff
path: root/shell/lash.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/lash.c')
-rw-r--r--shell/lash.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shell/lash.c b/shell/lash.c
index 92c24d1c2..eae949e18 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -710,7 +710,7 @@ static char * strsep_space( char *string, int * ix)
710 return NULL; 710 return NULL;
711 } 711 }
712 712
713 token = bb_xstrndup(string, *ix); 713 token = xstrndup(string, *ix);
714 714
715 return token; 715 return token;
716} 716}
@@ -751,7 +751,7 @@ static int expand_arguments(char *command)
751 751
752 /* We need a clean copy, so strsep can mess up the copy while 752 /* We need a clean copy, so strsep can mess up the copy while
753 * we write stuff into the original (in a minute) */ 753 * we write stuff into the original (in a minute) */
754 cmd = cmd_copy = bb_xstrdup(command); 754 cmd = cmd_copy = xstrdup(command);
755 *command = '\0'; 755 *command = '\0';
756 for (ix = 0, tmpcmd = cmd; 756 for (ix = 0, tmpcmd = cmd;
757 (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) { 757 (tmpcmd = strsep_space(cmd, &ix)) != NULL; cmd += ix, ix=0) {
@@ -1123,10 +1123,10 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
1123 prog->argv[argc_l] = NULL; 1123 prog->argv[argc_l] = NULL;
1124 1124
1125 if (!return_command) { 1125 if (!return_command) {
1126 job->text = bb_xstrdup(*command_ptr); 1126 job->text = xstrdup(*command_ptr);
1127 } else { 1127 } else {
1128 /* This leaves any trailing spaces, which is a bit sloppy */ 1128 /* This leaves any trailing spaces, which is a bit sloppy */
1129 job->text = bb_xstrndup(*command_ptr, return_command - *command_ptr); 1129 job->text = xstrndup(*command_ptr, return_command - *command_ptr);
1130 } 1130 }
1131 1131
1132 *command_ptr = return_command; 1132 *command_ptr = return_command;
@@ -1543,7 +1543,7 @@ int lash_main(int argc_l, char **argv_l)
1543 input = NULL; 1543 input = NULL;
1544 if (local_pending_command != 0) 1544 if (local_pending_command != 0)
1545 bb_error_msg_and_die("multiple -c arguments"); 1545 bb_error_msg_and_die("multiple -c arguments");
1546 local_pending_command = bb_xstrdup(argv[optind]); 1546 local_pending_command = xstrdup(argv[optind]);
1547 optind++; 1547 optind++;
1548 argv = argv+optind; 1548 argv = argv+optind;
1549 break; 1549 break;
@@ -1575,7 +1575,7 @@ int lash_main(int argc_l, char **argv_l)
1575 } 1575 }
1576 } else if (!local_pending_command && argv[optind]) { 1576 } else if (!local_pending_command && argv[optind]) {
1577 //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]); 1577 //printf( "optind=%d argv[optind]='%s'\n", optind, argv[optind]);
1578 input = bb_xfopen(argv[optind], "r"); 1578 input = xfopen(argv[optind], "r");
1579 /* be lazy, never mark this closed */ 1579 /* be lazy, never mark this closed */
1580 llist_add_to(&close_me_list, (void *)(long)fileno(input)); 1580 llist_add_to(&close_me_list, (void *)(long)fileno(input));
1581 } 1581 }