summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-09-12 15:42:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-09-12 17:22:43 +0200
commit2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622 (patch)
tree604420595251dea45e5d6b873651cf84ada7ac39 /common
parent09a1a28233831c0d17085472e478bca1dba3a7ef (diff)
downloadbarebox-2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622.tar.gz
barebox-2dfb4028b4eb4843a3dfcf87fd9608ac04bbf622.tar.xz
filetype: add BMP support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/filetype.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/common/filetype.c b/common/filetype.c
index e736d43efe..61fca5aaba 100644
--- a/common/filetype.c
+++ b/common/filetype.c
@@ -42,6 +42,7 @@ static const char *filetype_str[] = {
[filetype_sh] = "Bourne Shell",
[filetype_mips_barebox] = "MIPS barebox image",
[filetype_fat] = "FAT filesytem",
+ [filetype_bmp] = "BMP image",
};
const char *file_type_to_string(enum filetype f)
@@ -101,6 +102,8 @@ enum filetype file_detect_type(void *_buf)
return filetype_mips_barebox;
if (is_fat(buf8))
return filetype_fat;
+ if (strncmp(buf8, "BM", 2) == 0)
+ return filetype_bmp;
return filetype_unknown;
}