forked from enlightenment/efl
*Not all white space is treated the same here, so using isspace is not
correct. In this case, use of isspace causes bugs where only the initial word of names is used, exe parameters are stripped, etc. *The exe params should be strdup'ed just like all the others. This one is my fault. SVN revision: 26108
This commit is contained in:
parent
2173bc5e08
commit
4069dd3a90
|
@ -74,14 +74,15 @@ ecore_desktop_ini_get(const char *file)
|
||||||
|
|
||||||
c = buffer;
|
c = buffer;
|
||||||
/* Strip preceeding blanks. */
|
/* Strip preceeding blanks. */
|
||||||
while ((*c != '\0') && (isspace(*c))) c++;
|
while (((*c == ' ') || (*c == '\t')) && (*c != '\n') && (*c != '\0'))
|
||||||
|
c++;
|
||||||
/* Skip blank lines and comments */
|
/* Skip blank lines and comments */
|
||||||
if ((*c == '\0') || (*c == '\n') || (*c == '#')) continue;
|
if ((*c == '\0') || (*c == '\n') || (*c == '#')) continue;
|
||||||
if (*c == '[') /* New group. */
|
if (*c == '[') /* New group. */
|
||||||
{
|
{
|
||||||
key = c + 1;
|
key = c + 1;
|
||||||
while ((*c != ']') && (*c != '\n') && (*c != '\0'))
|
while ((*c != ']') && (*c != '\n') && (*c != '\0'))
|
||||||
c++;
|
c++;
|
||||||
*c++ = '\0';
|
*c++ = '\0';
|
||||||
current = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
current = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
||||||
if (current)
|
if (current)
|
||||||
|
@ -100,20 +101,24 @@ ecore_desktop_ini_get(const char *file)
|
||||||
|
|
||||||
key = c;
|
key = c;
|
||||||
/* Find trailing blanks or =. */
|
/* Find trailing blanks or =. */
|
||||||
while ((*c != '\0') && (*c != '=') && (!isspace(*c))) c++;
|
while ((*c != '=') && (*c != ' ') && (*c != '\t') && (*c != '\n') && (*c != '\0'))
|
||||||
|
c++;
|
||||||
if (*c != '=') /* Find equals. */
|
if (*c != '=') /* Find equals. */
|
||||||
{
|
{
|
||||||
*c++ = '\0';
|
*c++ = '\0';
|
||||||
while ((*c != '\0') && (*c != '=')) c++;
|
while ((*c != '=') && (*c != '\n') && (*c != '\0'))
|
||||||
|
c++;
|
||||||
}
|
}
|
||||||
if (*c == '=') /* Equals found. */
|
if (*c == '=') /* Equals found. */
|
||||||
{
|
{
|
||||||
*c++ = '\0';
|
*c++ = '\0';
|
||||||
/* Strip preceeding blanks. */
|
/* Strip preceeding blanks. */
|
||||||
while ((*c != '\0') && (isspace(*c))) c++;
|
while (((*c == ' ') || (*c == '\t')) && (*c != '\n') && (*c != '\0'))
|
||||||
|
c++;
|
||||||
value = c;
|
value = c;
|
||||||
/* Find end. */
|
/* Find end. */
|
||||||
while ((*c != '\0') && (!isspace(*c))) c++;
|
while ((*c != '\n') && (*c != '\0'))
|
||||||
|
c++;
|
||||||
*c++ = '\0';
|
*c++ = '\0';
|
||||||
/* FIXME: should strip space at end, then unescape value. */
|
/* FIXME: should strip space at end, then unescape value. */
|
||||||
tv = ecore_hash_remove(current, key);
|
tv = ecore_hash_remove(current, key);
|
||||||
|
@ -248,7 +253,8 @@ _ecore_desktop_get(const char *file, const char *lang)
|
||||||
if (exe)
|
if (exe)
|
||||||
{
|
{
|
||||||
*exe = '\0';
|
*exe = '\0';
|
||||||
result->exec_params = ++exe;
|
exe++;
|
||||||
|
result->exec_params = strdup(exe);
|
||||||
}
|
}
|
||||||
exe = result->exec;
|
exe = result->exec;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue