From c4d3d44d8e7fe87e6c889c116c267954fca9ac1e Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Tue, 2 Feb 2010 21:50:39 -0500 Subject: [PATCH] upkg: Don't crash if the specified package does not exist. Currently, g_type_module_use(pkg) will succeed even if the package does not exist, due to the existence of shared-object-only packages. So the caller must look inside the UPkg structure to see if anything was actually opened. In the future, pending tools to create the things, such packages probably won't exist and this hack can be removed. --- src/upkg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/upkg.c b/src/upkg.c index 191444e..1e2c662 100644 --- a/src/upkg.c +++ b/src/upkg.c @@ -341,7 +341,7 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - if (!g_type_module_use(pkg)) { + if (!g_type_module_use(pkg) || !U_PKG(pkg)->pkg) { fprintf(stderr, "failed to load package: %s\n", pkg->name); return EXIT_FAILURE; } -- 2.43.2