From: Soeren Apel Date: Tue, 20 Mar 2018 08:41:51 +0000 (+0100) Subject: resource.c: Fix firmware loading bug (#1140) X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=366ccb8ab75f7291a11e677034085c702a1c5361;p=libsigrok.git resource.c: Fix firmware loading bug (#1140) --- 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)