FS#10392 - settings.c:set_file function should'nt modify filename argument

Attached to Project: Rockbox
Opened by Jonas Häggqvist (rasher) - Sunday, 28 June 2009, 17:18 GMT
Last edited by Alexander Levin (fml2) - Monday, 29 June 2009, 14:26 GMT
Task Type Patches
Category Configuration
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Version 3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


This simple patch stops set_file from modifying the filename argument.

Line 1157 sets the last / to \0, to split the filename variable into dir and basename. However, the dir part is only used in the following statement: strncasecmp(ROCKBOX_DIR, filename ,strlen(ROCKBOX_DIR)

Here, the comparison will be either true or false even without splitting the filename variable into dir part and basename part. I suspect it was previously doing a "dumber" comparison, and someone changed it to use strncasecmp, and didn't see this issue.

This is needed to fix a bug in  FS#10931  that would cause themes to not load at all.
This task depends upon

View Dependency Graph

This task blocks these from closing
 FS#10391 - Center on loaded theme 
Closed by  Alexander Levin (fml2)
Monday, 29 June 2009, 14:26 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed in r21551.