summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/efreet/efreet_desktop.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_desktop.c b/src/lib/efreet/efreet_desktop.c
index f0c46d4c33..4e97dc1efb 100644
--- a/src/lib/efreet/efreet_desktop.c
+++ b/src/lib/efreet/efreet_desktop.c
@@ -777,7 +777,22 @@ efreet_desktop_application_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini
777 if (val) desktop->path = strdup(val); 777 if (val) desktop->path = strdup(val);
778 778
779 val = efreet_ini_string_get(ini, "StartupWMClass"); 779 val = efreet_ini_string_get(ini, "StartupWMClass");
780 if (val) desktop->startup_wm_class = strdup(val); 780 if ((val) && (val[0]) && (val[1]))
781 {
782 size_t len = strlen(val);
783 if (((val[0] == '"') && (val[len - 1] == '"') ) ||
784 ((val[0] == '\'') && (val[len - 1] == '\'')))
785 {
786 // fixup for some spec-violating apps that put startupwmclass
787 // in quotes... spec doesnt allow for this. just escapes.
788 char *tmpval = alloca(len - 1);
789 strncpy(tmpval, val + 1, len - 2);
790 tmpval[len - 2] = '\0';
791 desktop->startup_wm_class = strdup(tmpval);
792 }
793 else
794 desktop->startup_wm_class = strdup(val);
795 }
781 796
782 val = efreet_ini_string_get(ini, "Categories"); 797 val = efreet_ini_string_get(ini, "Categories");
783 if (val) 798 if (val)