normalize away spurious percent arguments in the executable

SVN revision: 39608
devs/princeamd/enlightenment-0.17-elive
Viktor Kojouharov 14 years ago
parent d19e0ba2dc
commit 6927a37b23
  1. 22
      src/bin/e_exehist.c

@ -450,6 +450,7 @@ _e_exehist_normalize_exe(const char *exe)
{
char *base, *cp, *space = NULL;
const char *ret;
Eina_Bool flag = EINA_FALSE;
base = basename(exe);
if (base[0] == '.' && base[1] == '\0')
@ -463,13 +464,23 @@ _e_exehist_normalize_exe(const char *exe)
{
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++;
}
@ -479,6 +490,7 @@ _e_exehist_normalize_exe(const char *exe)
ret = eina_stringshare_add(base);
free(base);
return ret;
}

Loading…
Cancel
Save