{
char *base, *cp, *space = NULL;
const char *ret;
+ Eina_Bool flag = EINA_FALSE;
base = basename(exe);
if (base[0] == '.' && base[1] == '\0')
{
if (!space)
space = cp;
+ if (flag)
+ flag = EINA_FALSE;
}
- else
+ else if (!flag)
{
- char lower = tolower(*cp);
- if (lower != *cp)
- *cp = lower;
- space = NULL;
+
+ /* usually a variable in the desktop exe field */
+ if (space && *cp == '%')
+ flag = EINA_TRUE;
+ else
+ {
+ char lower = tolower(*cp);
+ space = NULL;
+
+ if (lower != *cp)
+ *cp = lower;
+ }
}
cp++;
}
ret = eina_stringshare_add(base);
free(base);
+
return ret;
}