Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#4729 - text viewer setting saving not working on ipods

Attached to Project: Rockbox
Opened by Frederik (freqmod) - Saturday, 25 February 2006, 14:09 GMT+1
Last edited by Christi Scarborough (christi-s) - Sunday, 19 March 2006, 16:47 GMT+1
Task Type Bugs
Category Plugins
Status Closed
Assigned To No-one
Player type iPod Nano
Severity Low
Priority Normal
Reported Version
Due in Version Version 3.1
Due Date Undecided
Percent Complete 100%
Private No

Details

The text viewer is not able to load settings on the ipod becase of sizeof(char*) includes the \\0 char at the end:
i have created the following fix (but i have edited the file much more so i haven't created a patch):

static void viewer_load_settings(void) (around line 953):
change:
req_line_len = file_name_len + sizeof(viewer_settings_string);
to:
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
req_line_len = file_name_len + sizeof(viewer_settings_string)-1;//for ipods
#else
req_line_len = file_name_len + sizeof(viewer_settings_string);
#endif

static void viewer_save_settings(void) (around line 1010):

change:
req_line_len = file_name_len + sizeof(viewer_settings_string);
to:
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
req_line_len = file_name_len + sizeof(viewer_settings_string)-1;//for ipods
#else
req_line_len = file_name_len + sizeof(viewer_settings_string);
#endif

change:
rb->write(settings_fd, &prefs, sizeof(prefs));
to:
#if (CONFIG_CPU==PP5002) || (CONFIG_CPU==PP5020) || (CONFIG_CPU==PNX0101)
rb->write(settings_fd, &prefs, sizeof(prefs)-sizeof(char));//for ipods
#else
rb->write(settings_fd, &prefs, sizeof(prefs));
#endif
This task depends upon

Closed by  Daniel Stenberg (bagder)
Saturday, 19 May 2007, 17:12 GMT+1
Reason for closing:  Out of Date
Comment by Linus Nielsen Feltzing (linusnielsen) - Sunday, 26 February 2006, 13:27 GMT+1
I don't see how sizeof(char*) has anything to do with it. Maybe you mean strlen()? If it is strlen() that is the problem, I suggest we fix that bug instead of patching the text viewer.
Comment by Anton Romanov (theli) - Thursday, 20 April 2006, 15:52 GMT+1
well, i have this bug on my iPod Mini 2g too ...

apart from bug with settings ...
viewer puts some character ( with my unicode font it looks like 'J' ) in places of empty strings...
this is also (as i think ) deals with sizes

for example part from .rockbox/docs/LICENSES
_______________
...followed by the license text.

**************...
_______________
looks like
_______________
...followed by the license text.
J
**************...
_______________

any idea why this is happening to ipod builds?
Comment by Jonathan Gordon (jdgordon) - Tuesday, 06 February 2007, 10:12 GMT+1
is this still a bug?
Comment by Frederik (freqmod) - Tuesday, 06 February 2007, 12:01 GMT+1
I don't think so, but I cant test it as my iPod is away for repear.

Loading...