diff options
author | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-08-03 15:41:12 +0000 |
---|---|---|
committer | landley <landley@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2006-08-03 15:41:12 +0000 |
commit | 5e2a5391f9142bca773aab4c829615895b69a6b7 (patch) | |
tree | e4a2769349867c441cf2983d83097bb66701a733 /shell/lash.c | |
parent | e883e03918a0e26e390ea23996abdb8fc1925f88 (diff) | |
download | busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.gz busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.tar.bz2 busybox-w32-5e2a5391f9142bca773aab4c829615895b69a6b7.zip |
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes... General cleanup pass. What I've
been doing for the last couple days.
And it conflicts! I've removed httpd.c from this checkin due to somebody else
touching that file. It builds for me. I have to catch a bus. (Now you know
why I'm looking forward to Mercurial.)
git-svn-id: svn://busybox.net/trunk/busybox@15767 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell/lash.c')
-rw-r--r-- | shell/lash.c | 12 |
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 | } |