Try to make indent formatting less horrible
This commit is contained in:
parent
e64bf409dd
commit
252183e3f5
@ -92,18 +92,17 @@ static int xargs_exec(char *const *args)
|
||||
return exec_errno == ENOENT ? 127 : 126;
|
||||
} else {
|
||||
if (WEXITSTATUS(status) == 255) {
|
||||
bb_error_msg("%s: exited with status 255; aborting",
|
||||
args[0]);
|
||||
bb_error_msg("%s: exited with status 255; aborting", args[0]);
|
||||
return 124;
|
||||
}
|
||||
if (WIFSTOPPED(status)) {
|
||||
bb_error_msg("%s: stopped by signal %d", args[0],
|
||||
WSTOPSIG(status));
|
||||
bb_error_msg("%s: stopped by signal %d",
|
||||
args[0], WSTOPSIG(status));
|
||||
return 125;
|
||||
}
|
||||
if (WIFSIGNALED(status)) {
|
||||
bb_error_msg("%s: terminated by signal %d", args[0],
|
||||
WTERMSIG(status));
|
||||
bb_error_msg("%s: terminated by signal %d",
|
||||
args[0], WTERMSIG(status));
|
||||
return 125;
|
||||
}
|
||||
if (WEXITSTATUS(status) != 0)
|
||||
@ -130,8 +129,8 @@ static int eof_stdin_detected;
|
||||
|| (c) == '\f' || (c) == '\v')
|
||||
|
||||
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_QUOTES
|
||||
static xlist_t *process_stdin(xlist_t * list_arg, const char *eof_str,
|
||||
size_t mc, char *buf)
|
||||
static xlist_t *process_stdin(xlist_t * list_arg,
|
||||
const char *eof_str, size_t mc, char *buf)
|
||||
{
|
||||
#define NORM 0
|
||||
#define QUOTE 1
|
||||
@ -200,9 +199,10 @@ static xlist_t *process_stdin(xlist_t * list_arg, const char *eof_str,
|
||||
}
|
||||
}
|
||||
if (state == SPACE) { /* word's delimiter or EOF detected */
|
||||
if (q)
|
||||
if (q) {
|
||||
bb_error_msg_and_die("unmatched %s quote",
|
||||
q == '\'' ? "single" : "double");
|
||||
}
|
||||
/* word loaded */
|
||||
if (eof_str) {
|
||||
eof_str_detected = strcmp(s, eof_str) == 0;
|
||||
@ -233,9 +233,9 @@ static xlist_t *process_stdin(xlist_t * list_arg, const char *eof_str,
|
||||
return list_arg;
|
||||
}
|
||||
#else
|
||||
/* The variant is unsupport single, double quotes and backslash */
|
||||
static xlist_t *process_stdin(xlist_t * list_arg, const char *eof_str,
|
||||
size_t mc, char *buf)
|
||||
/* The variant does not support single quotes, double quotes or backslash */
|
||||
static xlist_t *process_stdin(xlist_t * list_arg,
|
||||
const char *eof_str, size_t mc, char *buf)
|
||||
{
|
||||
|
||||
int c; /* current char */
|
||||
@ -434,8 +434,7 @@ int xargs_main(int argc, char **argv)
|
||||
size_t n_max_chars;
|
||||
|
||||
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM
|
||||
xlist_t *(*read_args) (xlist_t *, const char *, size_t, char *) =
|
||||
process_stdin;
|
||||
xlist_t *(*read_args) (xlist_t *, const char *, size_t, char *) = process_stdin;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION
|
||||
@ -472,8 +471,7 @@ int xargs_main(int argc, char **argv)
|
||||
n_chars += strlen(*argv) + 1;
|
||||
}
|
||||
if (n_max_chars < n_chars) {
|
||||
bb_error_msg_and_die
|
||||
("can not fit single argument within argument list size limit");
|
||||
bb_error_msg_and_die("can not fit single argument within argument list size limit");
|
||||
}
|
||||
n_max_chars -= n_chars;
|
||||
} else {
|
||||
@ -498,8 +496,9 @@ int xargs_main(int argc, char **argv)
|
||||
read_args = process0_stdin;
|
||||
#endif
|
||||
|
||||
while ((list = READ_ARGS(list, eof_str, n_max_chars, max_chars)) != NULL
|
||||
|| (opt & OPT_NO_EMPTY) == 0) {
|
||||
while ((list = READ_ARGS(list, eof_str, n_max_chars, max_chars)) != NULL ||
|
||||
(opt & OPT_NO_EMPTY) == 0)
|
||||
{
|
||||
opt |= OPT_NO_EMPTY;
|
||||
n = 0;
|
||||
n_chars = 0;
|
||||
@ -575,8 +574,7 @@ const char *bb_applet_name = "debug stuff usage";
|
||||
|
||||
void bb_show_usage(void)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
|
||||
fprintf(stderr, "Usage: %s [-p] [-r] [-t] -[x] [-n max_arg] [-s max_chars]\n",
|
||||
bb_applet_name);
|
||||
exit(1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user