* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
//config:config PASTE
-//config: bool "paste"
+//config: bool "paste (4.5 kb)"
//config: default y
//config: help
-//config: paste is used to paste lines of different files together
-//config: and write the result to stdout
+//config: paste is used to paste lines of different files together
+//config: and write the result to stdout
//applet:IF_PASTE(APPLET_NOEXEC(paste, paste, BB_DIR_USR_BIN, BB_SUID_DROP, paste))
{
char *line;
char delim;
- int del_idx = 0;
int active_files = file_cnt;
int i;
while (active_files > 0) {
+ int del_idx = 0;
+
for (i = 0; i < file_cnt; ++i) {
if (files[i] == NULL)
continue;
{
char *line, *next_line;
char delim;
- int del_idx = 0;
int i;
for (i = 0; files[i]; ++i) {
+ int del_idx = 0;
+
line = NULL;
while ((next_line = xmalloc_fgetline(files[i])) != NULL) {
if (line) {
(--argv)[0] = (char*) "-";
for (i = 0; argv[i]; ++i) {
argv[i] = (void*) fopen_or_warn_stdin(argv[i]);
- if (!argv[i])
+ if (!argv[i])
xfunc_die();
}