Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bugs
  • Category Plugins
  • Assigned To No-one
  • Operating System iPod Nano
  • Severity Low
  • Priority Very Low
  • Reported Version
  • Due in Version Version 3.1
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by Frederik - 2006-02-25
Last edited by Christi Scarborough - 2006-03-19

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

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

Closed by  Daniel Stenberg
2007-05-19 15:12
Reason for closing:  Out of Date
Admin
Linus Nielsen Feltzing commented on 2006-02-26 12:27

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.

Anton Romanov commented on 2006-04-20 13:52

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?

Jonathan Gordon commented on 2007-02-06 09:12

is this still a bug?

Frederik commented on 2007-02-06 11:01

I don’t think so, but I cant test it as my iPod is away for repear.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing