Date: Fri, 20 Nov 2020 16:10:56 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 251275] shells/ksh2020 "complete -F" doesn't work unless the prefix length is exactly 3 Message-ID: <bug-251275-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D251275 Bug ID: 251275 Summary: shells/ksh2020 "complete -F" doesn't work unless the prefix length is exactly 3 Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: cy@FreeBSD.org Reporter: endian.sign@gmail.com Flags: maintainer-feedback?(cy@FreeBSD.org) Assignee: cy@FreeBSD.org Created attachment 219832 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D219832&action= =3Dedit Don't reassign the "len" variable and compute the exact spaces needed Hi, The programmable completion of ksh2020 doesn't work as expected unless the prefix length is exactly 3. The following example illustrates the problem: $ set -o emacs $ _foo() > { > COMPREPLY=3D( hello world ) > } $ complete -F _foo foo $ foo <tab> # Nothing is displayed. $ foo hel<tab> # This one works as expected. The problem is caused by a reassignment of the prefix length. Moreover, we might overwrite data on the heap if the total length of all completion stri= ngs is big enough. The attached patch fixes the problem. --=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-251275-7788>