From abdb5a8f031ea20777ddbba110a18f82ed5f2b9b Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 7 Dec 2023 16:06:30 +0300 Subject: [PATCH] xargs fix: r_flag --- findutils/xargs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/findutils/xargs.c b/findutils/xargs.c index 2b365ab..110408a 100644 --- a/findutils/xargs.c +++ b/findutils/xargs.c @@ -45,7 +45,12 @@ int stdin_read(void) { int args_passed = 0; while (1) { int c = getchar(); - if ((isspace(c) && strlen(arg) > 0) || c == EOF) { + if (c == EOF) { + ret = 2; + break; + } + + else if (isspace(c) && strlen(arg) > 0) { *p = '\0'; p = arg; @@ -53,10 +58,6 @@ int stdin_read(void) { break; args_passed++; - if (c == EOF) { - ret = 2; - break; - } } else {