diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-03-19 21:42:50 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-03-19 21:42:50 +0000 |
commit | e86218b859a13ed5b391c03baa55e8bae756a4ac (patch) | |
tree | ce94be405f4afe69f289088d9e418ffa9a7d211e /tools | |
parent | 6c0e419dd0ad875eeba6ba4cffc4b230af21aca4 (diff) | |
download | rockbox-e86218b859a13ed5b391c03baa55e8bae756a4ac.tar.gz 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.c | 11 |
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) | |||
406 | 406 | ||
407 | if (!id) | 407 | if (!id) |
408 | { | 408 | { |
409 | id = strdup(bmp_filename); | 409 | char *ptr=strrchr(bmp_filename, '/'); |
410 | for (i = 0; id[i]; i++) if (id[i] == '.') id[i] = '\0'; | 410 | if(ptr) |
411 | ptr++; | ||
412 | else | ||
413 | ptr = bmp_filename; | ||
414 | id = strdup(ptr); | ||
415 | for (i = 0; id[i]; i++) | ||
416 | if (id[i] == '.') | ||
417 | id[i] = '\0'; | ||
411 | } | 418 | } |
412 | 419 | ||
413 | if (read_bmp_file(bmp_filename, &width, &height, &bitmap)) | 420 | if (read_bmp_file(bmp_filename, &width, &height, &bitmap)) |