efreet - fix mime file path messing with short paths like /
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 Jul 2016 06:56:43 +0000 (15:56 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 5 Jul 2016 07:28:52 +0000 (16:28 +0900)
this fixes T4015

@fix

src/lib/efreet/efreet_mime.c
src/modules/evas/engines/gl_cocoa/evas_gl_cocoa_main.m
src/modules/evas/engines/gl_x11/evas_x_main.c
src/modules/evas/engines/wayland_egl/evas_wl_main.c

index adfa790..87ca8ef 100644 (file)
@@ -711,10 +711,13 @@ efreet_mime_special_check(const char *file)
                parent[PATH_MAX - 1] = '\0';
 
                /* Kill any trailing slash */
-               parent[--path_len] = '\0';
+               if (parent[path_len - 1] == '/')
+                 parent[--path_len] = '\0';
 
                /* Truncate to last slash */
-               while (parent[--path_len] != '/') parent[path_len] = '\0';
+               while ((path_len > 0) &&
+                      (parent[--path_len] != '/'))
+                 parent[path_len] = '\0';
 
 #ifdef _WIN32
                if (!stat(file, &s2))
index 15dc218..7df919f 100644 (file)
@@ -120,6 +120,7 @@ eng_window_free(Evas_GL_Cocoa_Window *gw)
 void
 eng_window_use(Evas_GL_Cocoa_Window *gw)
 {
+   if ((gw) && (!gw->gl_context)) return;
    if (_evas_gl_cocoa_window != gw)
      {
         [[(NSOpenGLView*)gw->view openGLContext] makeCurrentContext];
index 59361e1..f5e2edf 100644 (file)
@@ -676,6 +676,8 @@ eng_window_use(Outbuf *gw)
    xwin = _tls_outbuf_get();
 
    glsym_evas_gl_preload_render_lock(eng_window_make_current, gw);
+   if ((gw) && (!gw->gl_context)) return;
+
 #ifdef GL_GLES
    if (xwin)
      {
index 489a475..14e13ff 100644 (file)
@@ -233,6 +233,7 @@ eng_window_use(Outbuf *gw)
    Eina_Bool force = EINA_FALSE;
 
    glsym_evas_gl_preload_render_lock(eng_preload_make_current, gw);
+   if ((gw) && (!gw->gl_context)) return;
 
    if (_evas_gl_wl_window)
      {