From 6927a37b2320ad10d253b17f404822bb73578b8f Mon Sep 17 00:00:00 2001 From: Viktor Kojouharov Date: Sat, 21 Mar 2009 11:48:45 +0000 Subject: [PATCH] normalize away spurious percent arguments in the executable SVN revision: 39608 --- src/bin/e_exehist.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/bin/e_exehist.c b/src/bin/e_exehist.c index b7704a23b..de2d17e7d 100644 --- a/src/bin/e_exehist.c +++ b/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; }