BUG: viewing compressed files

Adam Byrtek / alpha alpha at informatica.agh.edu.pl
Mon Jun 30 07:19:26 UTC 2003


On Sun, Jun 29, 2003 at 07:08:15PM -0400, Pavel Roskin wrote:
> > I can add, that F4 on gzipped file opens it correctly, but leaves broken
> > symlink after closing the editor. This happens in mc-4.6.0-2003-06-25-17
> > but not in 4.6.0 version.
> 
> It's a write lock.  It needs to be fixed.  Adam, it's your code.

Shame on me I didn't notice that filtered edit uses edit_insert_file
to init its buffer :( Simple fix attached with additional routine to
remove stale lock during editor cleanup...

-- 

  _.|._ |_  _.   :  Adam Byrtek /alpha               alpha at debian.org
 (_|||_)| |(_|   :  http://krakow.linux.org.pl/        pgp 0xB25952C0
     |           
-------------- next part --------------
Index: edit.c
===================================================================
RCS file: /cvsroot/mc/mc/edit/edit.c,v
retrieving revision 1.77
diff -u -r1.77 edit.c
--- edit.c	30 May 2003 21:06:10 -0000	1.77
+++ edit.c	30 Jun 2003 07:13:56 -0000
@@ -441,6 +441,11 @@
 		edit_clean (edit);
 		return 1;
 	    }
+
+	    /* edit_insert_file has locked the file, remove the lock */
+	    if (edit->locked)
+		edit->locked = edit_unlock_file (edit->filename);
+
 	    edit->stack_disable = 0;
 	}
     }
@@ -583,6 +588,10 @@
     if (!edit)
 	return 0;
 
+    /* a stale lock, remove it */
+    if (edit->locked)
+	edit->locked = edit_unlock_file (edit->filename);
+    
     /* save cursor position */
     if (option_save_position)
 	edit_save_position (edit);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.midnight-commander.org/pipermail/mc-devel/attachments/20030630/a70f4b22/attachment.asc>


More information about the mc-devel mailing list