summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-03-19 21:42:50 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-03-19 21:42:50 +0000
commite86218b859a13ed5b391c03baa55e8bae756a4ac (patch)
treece94be405f4afe69f289088d9e418ffa9a7d211e /tools
parent6c0e419dd0ad875eeba6ba4cffc4b230af21aca4 (diff)
downloadrockbox-e86218b859a13ed5b391c03baa55e8bae756a4ac.tar.gz
rockbox-e86218b859a13ed5b391c03baa55e8bae756a4ac.tar.bz2
rockbox-e86218b859a13ed5b391c03baa55e8bae756a4ac.zip
autodetect an ID smarter
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3486 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rw-r--r--tools/bmp2rb.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/bmp2rb.c b/tools/bmp2rb.c
index cd850d1f93..2fbfcc1a16 100644
--- a/tools/bmp2rb.c
+++ b/tools/bmp2rb.c
@@ -406,8 +406,15 @@ int main(int argc, char **argv)
if (!id)
{
- id = strdup(bmp_filename);
- for (i = 0; id[i]; i++) if (id[i] == '.') id[i] = '\0';
+ char *ptr=strrchr(bmp_filename, '/');
+ if(ptr)
+ ptr++;
+ else
+ ptr = bmp_filename;
+ id = strdup(ptr);
+ for (i = 0; id[i]; i++)
+ if (id[i] == '.')
+ id[i] = '\0';
}
if (read_bmp_file(bmp_filename, &width, &height, &bitmap))