summaryrefslogtreecommitdiff
path: root/src/lib/efreet
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 15:56:43 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2016-07-05 16:28:52 +0900
commit2ca5075193e27dbc30f26e478019719a5360cc84 (patch)
tree572e538109ae08ad92729a4f1307fdc877754245 /src/lib/efreet
parente24366de25c3ae5a26fd1f1e8d77bc4b7c13c0be (diff)
efreet - fix mime file path messing with short paths like /
this fixes T4015 @fix
Diffstat (limited to 'src/lib/efreet')
-rw-r--r--src/lib/efreet/efreet_mime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index adfa79053a..87ca8ef414 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -711,10 +711,13 @@ efreet_mime_special_check(const char *file)
711 parent[PATH_MAX - 1] = '\0'; 711 parent[PATH_MAX - 1] = '\0';
712 712
713 /* Kill any trailing slash */ 713 /* Kill any trailing slash */
714 parent[--path_len] = '\0'; 714 if (parent[path_len - 1] == '/')
715 parent[--path_len] = '\0';
715 716
716 /* Truncate to last slash */ 717 /* Truncate to last slash */
717 while (parent[--path_len] != '/') parent[path_len] = '\0'; 718 while ((path_len > 0) &&
719 (parent[--path_len] != '/'))
720 parent[path_len] = '\0';
718 721
719#ifdef _WIN32 722#ifdef _WIN32
720 if (!stat(file, &s2)) 723 if (!stat(file, &s2))