summaryrefslogtreecommitdiff
path: root/tools/bmp2rb.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bmp2rb.c')
-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)
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))