From 366ccb8ab75f7291a11e677034085c702a1c5361 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Tue, 20 Mar 2018 09:41:51 +0100 Subject: [PATCH] resource.c: Fix firmware loading bug (#1140) --- src/resource.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/resource.c b/src/resource.c index 1e8d9458..03e63435 100644 --- a/src/resource.c +++ b/src/resource.c @@ -128,7 +128,11 @@ static FILE *try_open_file(const char *datadir, const char *subdir, char *filename; FILE *file; - filename = g_build_filename(datadir, subdir, name, NULL); + if (subdir) + filename = g_build_filename(datadir, subdir, name, NULL); + else + filename = g_build_filename(datadir, name, NULL); + file = g_fopen(filename, "rb"); if (file)