]> sigrok.org Git - libsigrok.git/commitdiff
resource.c: Fix firmware loading bug (#1140)
authorSoeren Apel <redacted>
Tue, 20 Mar 2018 08:41:51 +0000 (09:41 +0100)
committerUwe Hermann <redacted>
Tue, 20 Mar 2018 15:13:46 +0000 (16:13 +0100)
src/resource.c

index 1e8d9458a0709a6d1bdc7199186c4d276d93cf17..03e63435c9de603661ec74ee3072b6a1142b016e 100644 (file)
@@ -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)