aboutsummaryrefslogtreecommitdiff
path: root/findutils/xargs.c
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /findutils/xargs.c
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
Major coreutils update.
Diffstat (limited to 'findutils/xargs.c')
-rw-r--r--findutils/xargs.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/findutils/xargs.c b/findutils/xargs.c
index 677618dc0..d4bed57f0 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -53,11 +53,11 @@ static void xargs_exec(char * const * args)
53 wait(NULL); 53 wait(NULL);
54 if(common[0]) { 54 if(common[0]) {
55 errno = common[0]; 55 errno = common[0];
56 perror_msg_and_die("%s", args[0]); 56 bb_perror_msg_and_die("%s", args[0]);
57 } 57 }
58 } 58 }
59 } else { 59 } else {
60 perror_msg_and_die("vfork"); 60 bb_perror_msg_and_die("vfork");
61 } 61 }
62} 62}
63 63
@@ -81,7 +81,7 @@ int xargs_main(int argc, char **argv)
81 flg_no_empty = 1; 81 flg_no_empty = 1;
82 break; 82 break;
83 default: 83 default:
84 show_usage(); 84 bb_show_usage();
85 } 85 }
86 } 86 }
87 87
@@ -101,9 +101,7 @@ int xargs_main(int argc, char **argv)
101 101
102 /* Now, read in one line at a time from stdin, and store this 102 /* Now, read in one line at a time from stdin, and store this
103 * line to be used later as an argument to the command */ 103 * line to be used later as an argument to the command */
104 while ((file_to_act_on = get_line_from_file(stdin)) != NULL) { 104 while ((file_to_act_on = bb_get_chomped_line_from_file(stdin)) != NULL) {
105 /* eat the newline off the filename. */
106 chomp(file_to_act_on);
107 if(file_to_act_on[0] != 0 || flg_no_empty == 0) { 105 if(file_to_act_on[0] != 0 || flg_no_empty == 0) {
108 args[a] = file_to_act_on[0] ? file_to_act_on : NULL; 106 args[a] = file_to_act_on[0] ? file_to_act_on : NULL;
109 if(flg_vi) { 107 if(flg_vi) {
@@ -114,7 +112,7 @@ int xargs_main(int argc, char **argv)
114 } 112 }
115 fprintf(stderr, "%s", ((flg_vi & 2) ? " ?..." : "\n")); 113 fprintf(stderr, "%s", ((flg_vi & 2) ? " ?..." : "\n"));
116 } 114 }
117 if((flg_vi & 2) == 0 || ask_confirmation() != 0 ) { 115 if((flg_vi & 2) == 0 || bb_ask_confirmation() != 0 ) {
118 xargs_exec(args); 116 xargs_exec(args);
119 } 117 }
120 } 118 }