Re: Couple of patches



Hello Pavel,
> 
> Thursday, November 25, 2004, 4:06:17 PM, you wrote:
> 
> execute.c.patch committed.

Thanks! And one more memory optimization, please.

-- 
Regards,
Andrew V. Samoilov.
--- ChangeLog.sav	Fri Nov 26 17:27:06 2004
+++ ChangeLog	Fri Nov 26 17:27:11 2004
@@ -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>
 
--- ext.c.sav	Wed Oct  6 18:40:52 2004
+++ ext.c	Fri Nov 26 17:17:52 2004
@@ -297,7 +297,7 @@ exec_extension (const char *filename, co
  * 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;
 
@@ -357,12 +357,11 @@ regex_check_type (const char *filename, 
 	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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]