Date: Sat, 15 Apr 2023 16:17:13 +0000 From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 270867] xargs -E is not working properly Message-ID: <bug-270867-227-sXrm60qKOk@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-270867-227@https.bugs.freebsd.org/bugzilla/> References: <bug-270867-227@https.bugs.freebsd.org/bugzilla/>
next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D270867 Yuri Pankov <yuripv@FreeBSD.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |yuripv@FreeBSD.org --- Comment #1 from Yuri Pankov <yuripv@FreeBSD.org> --- Apparently foundeof check is passing the wrong length to strncmp(), we shou= ld be using the eofstr's one, not the current argument's: diff --git a/usr.bin/xargs/xargs.c b/usr.bin/xargs/xargs.c index 21455e7be26..89f75a4c386 100644 --- a/usr.bin/xargs/xargs.c +++ b/usr.bin/xargs/xargs.c @@ -349,7 +349,7 @@ arg1: if (insingle || indouble) { } arg2: foundeof =3D *eofstr !=3D '\0' && - strncmp(argp, eofstr, p - argp) =3D=3D 0; + strncmp(argp, eofstr, strlen(eofstr)) =3D=3D 0; /* Do not make empty args unless they are quoted */ if ((argp !=3D p || wasquoted) && !foundeof) { --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-270867-227-sXrm60qKOk>