simplify Open Terminal Here callback
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 5 Sep 2012 09:44:23 +0000 (09:44 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 5 Sep 2012 09:44:23 +0000 (09:44 +0000)
SVN revision: 76183

src/modules/fileman/e_fwin.c

index ff695f0..0ebc4ac 100644 (file)
@@ -1878,27 +1878,21 @@ _e_fwin_terminal(void *data,
 {
    E_Fwin *fwin = data;
    Efreet_Desktop *tdesktop;
+   char buf[PATH_MAX];
+   const char *path;
    
    if (!fwin->cur_page) return;
+   if (!getcwd(buf, sizeof(buf))) return;
    tdesktop = e_util_terminal_desktop_get();
-   if (tdesktop)
+   if (!tdesktop) return;
+   path = e_fm2_real_path_get(fwin->cur_page->fm_obj);
+   if (path)
      {
-        char buf[PATH_MAX];
-        
-        if (getcwd(buf, sizeof(buf)))
-          {
-             const char *path;
-             
-             path = e_fm2_real_path_get(fwin->cur_page->fm_obj);
-             if (path)
-               {
-                  chdir(path);
-                  e_exec(fwin->zone, tdesktop, NULL, NULL, "fileman");
-                  chdir(buf);
-               }
-          }
-        efreet_desktop_free(tdesktop);
+        chdir(path);
+        e_exec(fwin->zone, tdesktop, NULL, NULL, "fileman");
+        chdir(buf);
      }
+   efreet_desktop_free(tdesktop);
 }
 
 static void