Rockbox

  • Status Closed
  • Percent Complete
    100%
  • Task Type Patches
  • Category Drivers
  • Assigned To No-one
  • Operating System All players
  • Severity High
  • Priority Very Low
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: Rockbox
Opened by fml2 - 2006-07-29

FS#5736 - Correctly handle files with long names containing non-latin characters

Correctly handle files with long names containing non-latin characters (more precisely: files whose names, when utf8 encoded, require more than 255 bytes). This avoids player freeze when such files are present in the file system.

The patch does the following. When reading a entry for a file with long name, the name is first utf8-decoded into a temporary buffer. Then the check is made whether the content of the buffer would fit into the dir entry. If not, the long name is ignored and the short DOS name (which is OEM encoded) is used instead.

Beware: If this short name contains characters from the upper half of the code page, that name may appear with strange glyphs or empty character in the file browser. This is because Unicode characters 0×80 to 0x9F are control characters. They can’t be displayed.

Closed by  RaeNye
2006-07-31 23:00
Reason for closing:  Accepted
Additional comments about closing:   Warning: Undefined array key "typography" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 371 Warning: Undefined array key "camelcase" in /home/rockbox/flyspray/plugins/dokuwiki/inc/parserutils.php on line 407

P.S.
Please use spaces instead of tabs in RB code.

1. Please use diff -u next time.
2. Please avoid submitting only-whitespace changes.

The fixed patch is attached, later I’ll actually compile it.

I created a bad long file name that crashed the sim when viewing it, but the patch didn’t solve it.
Please check it on your sim.

fml2 commented on 2006-07-29 23:44

Sorry for the whitespace changes. My editor stripped trailing spaces when files were saved. I changed the editor configuration.

To the problem: is fat.c used in simulator builds? I haven’t found fat.o in the sim build directory. In the normal (=not sim) build fat.o is present (in firmware/drivers). So the patch may have no effect in the sim build.

fml2 commented on 2006-07-30 09:36

A better version of the patch: requires significantly less stack space. Also the padding FAT characters are handled correctly. Works well for me (iriver H1xx).

Project Manager

I like it. One small thing: please try to keep the source code lines shorter than 80 characters.

fml2 commented on 2006-07-30 11:55
One small thing: please try to keep the source code lines shorter than 80 characters.

Ok, I will in the future. I won’t correct this patch since there are many lines longer than 80 chars in fat.c anyway.

I’m ready to commit this patch;
I need your real name to do so.

fml2 commented on 2006-07-31 21:51

Here is a slightly improved patch (yet better handling of long name padding; made the function static)

My name is Alexander Levin

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing