diff --git a/src/ChangeLog b/src/ChangeLog index 178f4730c..6df59c66a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,9 @@ 2001-07-06 Pavel Roskin + * view.c (exec_extension): Unlink temporary file earlier if it's + not going to be used. + [OLD_CODE]: Remove. + * Makefile.in: Use additional quotes to preserve @prefix@ when Makefile is generated. diff --git a/src/ext.c b/src/ext.c index f4fbc4fac..94757efda 100644 --- a/src/ext.c +++ b/src/ext.c @@ -247,7 +247,15 @@ exec_extension (const char *filename, const char *data, char **drops, int *move_ } /* for */ fputc ('\n', cmd_file); fclose (cmd_file); - chmod (file_name, S_IRWXU); + + if ((run_view && !written_nonspace) || is_cd) { + unlink (file_name); + g_free (file_name); + file_name = NULL; + } else { + chmod (file_name, S_IRWXU); + } + if (run_view){ altered_hex_mode = 0; altered_nroff_flag = 0; @@ -302,22 +310,17 @@ exec_extension (const char *filename, const char *data, char **drops, int *move_ } } #endif /* !HAVE_X */ - -#ifdef OLD_CODE - if (vfs_current_is_local ()) - shell_execute (file_name, EXECUTE_INTERNAL); - else - message (1, _(" Warning "), _(" Can't execute commands on a Virtual File System directory ")); -#endif } #ifndef PORT_DOES_BACKGROUND_EXEC - unlink (file_name); + if (file_name) { + unlink (file_name); + g_free (file_name); + } #endif if (localcopy) { mc_stat (localcopy, &mystat); mc_ungetlocalcopy (filename, localcopy, localmtime != mystat.st_mtime); } - g_free (file_name); } #ifdef FILE_L