+Specific user error for loading MS Cabinet files (*.??_).
authorlace <>
Mon, 26 Dec 2005 09:57:13 +0000 (09:57 +0000)
committerlace <>
Mon, 26 Dec 2005 09:57:13 +0000 (09:57 +0000)
src/libcaptive/client/options-module.c

index a81c2e5..8b83174 100644 (file)
@@ -37,6 +37,8 @@
 
 gboolean captive_options_module_load(struct captive_options_module *options_module,const gchar *pathname_utf8)
 {
+const guint8 magic_mscf[]={'M','S','C','F',0,0,0,0};
+
        g_return_val_if_fail(options_module!=NULL,FALSE);
        g_return_val_if_fail(pathname_utf8!=NULL,FALSE);
 
@@ -77,6 +79,11 @@ char *hex,*s;
                        g_assert(isxdigit(*s));
                        }
                }
+       else if (options_module->u.pe32.length>=sizeof(magic_mscf)
+                       && !memcmp(options_module->u.pe32.base,magic_mscf,sizeof(magic_mscf))) {
+               g_error(_("Compressed cabinet file (\"*.??_\") not loadable - you must use cabextract(1) or EXPAND.EXE first: %s"),
+                               pathname_utf8);
+               }
        else {
                captive_rtl_file_munmap(options_module->u.pe32.base);
                options_module->type=CAPTIVE_OPTIONS_MODULE_TYPE_GMODULE;