summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--legacy/efreet/src/lib/efreet_base.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/legacy/efreet/src/lib/efreet_base.c b/legacy/efreet/src/lib/efreet_base.c
index d996a6b738..a4df1480ac 100644
--- a/legacy/efreet/src/lib/efreet_base.c
+++ b/legacy/efreet/src/lib/efreet_base.c
@@ -21,6 +21,7 @@ void *alloca (size_t);
21#endif 21#endif
22 22
23#include <unistd.h> 23#include <unistd.h>
24#include <ctype.h>
24 25
25#ifdef _WIN32 26#ifdef _WIN32
26# include <winsock2.h> 27# include <winsock2.h>
@@ -524,9 +525,16 @@ efreet_user_dir_get(const char *key, const char *fallback)
524 if (!eq) continue; 525 if (!eq) continue;
525 if (strncmp(key, line->start, eq - line->start)) continue; 526 if (strncmp(key, line->start, eq - line->start)) continue;
526 if (++eq >= line->end) continue; 527 if (++eq >= line->end) continue;
527 if (*eq != '"') continue; 528 if (*eq == '"')
528 if (++eq >= line->end) continue; 529 {
529 end = memchr(eq, '"', line->end - eq); 530 if (++eq >= line->end) continue;
531 end = memchr(eq, '"', line->end - eq);
532 }
533 else
534 {
535 end = line->end;
536 while (isspace(*end)) end--;
537 }
530 if (!end) continue; 538 if (!end) continue;
531 ret = alloca(end - eq + 1); 539 ret = alloca(end - eq + 1);
532 memcpy(ret, eq, end - eq); 540 memcpy(ret, eq, end - eq);