replace applicable calls to strlcpy with calls to strmemccpy
which null terminates on truncation
in theory the strmemccpy calls should be slightly faster since they
don't traverse the rest of the source string on truncation
but I seriously doubt there is too much of that going on in the code base
Change-Id: Ia0251514e36a6242bbf3f03c5e0df123aba60ed2
| with some code refactoring we can eliminate the static
char buffer in get_full_path()
I'm guessing making the functions recursive prompted the static buffer
I don't see any reason we can't just pass the same buffer
|
During tested I noted failure after buffer was full
-- splash added for buffer full notification
added some logic to not add partial entries and try to find a
| selected item that will fit in the remaing buffer
------------------------------------------------------------------------
While looking through the source I noticed a few potential
pitfalls with the current code.
Namely the stack allocated temporary buffer
sized to setting_len.
I also noted the rigid vect[32] with the timeless --
/* 32 separate folders should be Enough For Everybody(TM) */
and decided to make it a bit more robust
The saved items are hashed with crc32 on all the paths
and a hashed_len is kept to aid in the buffer full message before the
user actually goes to save the changes
(assuming they even get the message)
In the old code, buffer might be the same since it ran out of
space and didn't get their later selections
the hashed_len could easily be turned into a way to get a needed buffer
size as well for someone in the future just pass a really large maxlen
I made get_full_path non recursive since it liked to blow the stack
while embedded in all the other recursive calls making it a pain to debug
(the real reason the buffer was static?)
traverse first from the current folder to root mutating the
parent pointers to point at the previous child
next traverse back to the folder unmutating & taking names on the way
Folder depth is now uint16 65535 levels is probably excessive
children_count is also uint16 as well
I made the first folders below root '/' stay below root
instead of shifting since the horizontal real estate is limited
slightly smaller than it began but hopefully faster & more reliable
Change-Id: I348f61baf865cccdeacddfd9d50641a882e890fc
Doing a LONG PRESS on a:
- unopened folder will select all its sub-folders
- opened folder will invert the selection of its sub-folders
Change-Id: Ia7fd8dc3b940f60adee3f0314bf6bba5eb2c7b3b
The browser lets the user pick one or more directories in a convinient
GUI browser. The initial directory list is read from a string
(separated by colons) and the resulting list is written back to the same
string (again separated by colons).
Note: The work was initially done by Jonathan Gordon, however I changed
it substantially so I claim autorship.
This selector is going to be used for autoresume and database scan folders.
Change-Id: Id1d3186dad783411eb5c6056ce93f5b6123c7aa0