Re: [PATCH v2] kconfig: nconf: stop endless search-up loops

2021-04-10 Thread Masahiro Yamada
On Sat, Apr 10, 2021 at 4:00 PM Mihai Moldovan wrote: > > * On 4/10/21 7:47 AM, Masahiro Yamada wrote: > > On Sun, Mar 28, 2021 at 6:52 PM Mihai Moldovan wrote: > >> + if ((index == -1) && (index == match_start)) > >> + return -1; > > > > We know 'index' is -1

Re: [PATCH v2] kconfig: nconf: stop endless search-up loops

2021-04-10 Thread Mihai Moldovan
* On 4/10/21 7:47 AM, Masahiro Yamada wrote: > On Sun, Mar 28, 2021 at 6:52 PM Mihai Moldovan wrote: >> + if ((index == -1) && (index == match_start)) >> + return -1; > > We know 'index' is -1 in the second comparison. > So, you can also write like this: > >

Re: [PATCH v2] kconfig: nconf: stop endless search-up loops

2021-04-09 Thread Masahiro Yamada
On Sun, Mar 28, 2021 at 6:52 PM Mihai Moldovan wrote: > > If the user selects the very first entry in a page and performs a > search-up operation (e.g., via [/][a][Up Arrow]), nconf will never > terminate searching the page. > > The reason is that in this case, the starting point will be set to

[PATCH v2] kconfig: nconf: stop endless search-up loops

2021-03-28 Thread Mihai Moldovan
If the user selects the very first entry in a page and performs a search-up operation (e.g., via [/][a][Up Arrow]), nconf will never terminate searching the page. The reason is that in this case, the starting point will be set to -1, which is then translated into (n - 1) (i.e., the last entry of