* ext.c (regex_check_type): Optimize memory usage.

This commit is contained in:
Andrew V. Samoilov 2004-11-26 15:47:31 +00:00
parent 09180a901a
commit 5f926f02a6
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,7 @@
2004-11-26 Andrew V. Samoilov <sav@bcs.zp.ua>
* execute.c (shell_execute): Optimize memory usage.
* ext.c (regex_check_type): Likewise.
2004-11-02 Pavel Tsekov <ptsekov@gmx.net>

View File

@ -296,7 +296,7 @@ exec_extension (const char *filename, const char *data, int *move_dir,
* Return 1 if the data is valid, 0 otherwise, -1 for fatal errors.
*/
static int
get_file_type_local (char *filename, char *buf, int buflen)
get_file_type_local (const char *filename, char *buf, int buflen)
{
int read_bytes = 0;
@ -356,12 +356,11 @@ regex_check_type (const char *filename, const char *ptr, int *have_type)
if (!localfile)
return -1;
realname = g_strdup (localfile);
realname = localfile;
got_data =
get_file_type_local (localfile, content_string,
sizeof (content_string));
mc_ungetlocalcopy (filename, localfile, 0);
g_free (localfile);
if (got_data > 0) {
char *pp;