Bug 5307 - off-by-one bug in text entry widget (beta remote)
: off-by-one bug in text entry widget (beta remote)
Status: RESOLVED FIXED
Product: SB Controller
Classification: Unclassified
Component: Development package
: unspecified
: All Other
: P2 normal (vote)
: ---
Assigned To: Squeezebox QA Team email alias
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-24 15:03 UTC by Robin Bowes
Modified: 2007-08-26 00:19 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robin Bowes 2007-08-24 15:03:16 UTC
Easiest way is to give an example:

1. Go to My Music|Search|Artists

The display shows:

8
9
>
{space}
a

2. Scroll down

The selector jumps to "a" (not {space})

I first noticed this in the Wireless password entry screen but it is also present in all searches, and I presume anywhere the widget is used.
Comment 1 KDF 2007-08-26 00:19:53 UTC
should be fixed at r343 (we'll need a new way to have the autolinks for change numbers if we want them)
please give it a try and reopen if there are any problems with what I've done.

For the record, here is the patch applied:
Index: Textinput.lua
===================================================================
--- Textinput.lua       (revision 342)
+++ Textinput.lua       (working copy)
@@ -104,8 +104,12 @@
        -- find current character
        local i = string.find(v, s2, 1, true)
 
-       -- move dir characters
-       i = i + dir
+       -- move dir characters, compensating for the initial nil value
+       if (not (dir > 0 and s2 == "")) then
+               i = i + dir
+       end
+
+       -- handle wrap around conditions
        if i < 1 then
                i = i + #v
        elseif i > #v then