From 1574cddbc1107a6119116328e9696a65108f867b Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Fri, 22 Oct 2004 09:40:22 +0000 Subject: [PATCH] Now we already unlock the file at the begining of exec_endedit(), because if an error occurs during saving, the file keeps locked. This is not a perfect solution, there are still problems. I have to figure out another one. --- modules/Command.pm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/Command.pm b/modules/Command.pm index 591c8b1..1479e2a 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -6,7 +6,7 @@ package Command; # Execute Dev-Editor's commands # # Author: Patrick Canterino -# Last modified: 2004-10-05 +# Last modified: 2004-10-22 # use strict; @@ -331,6 +331,14 @@ sub exec_endedit($$) my $content = $data->{'cgi'}->param('filecontent'); my $uselist = $data->{'uselist'}; + # We already unlock the file at the beginning of the + # subroutine, because if we have to abort this routine, + # the file keeps locked. + # Nobody else will access the file during this routine + # because of the concept of File::UseList. + + file_unlock($uselist,$virtual); + # Normalize newlines $content =~ s/\015\012|\012|\015/\n/g; @@ -362,11 +370,6 @@ sub exec_endedit($$) { # Saving of the file was successful - so unlock it! - file_unlock($uselist,$data->{'virtual'}); - # ^^^^^^^^^^^^^^^^^^ - # Maybe the user saved the file using another filename... - # But we have to unlock the original file! - return devedit_reload({command => 'show', file => upper_path($virtual)}); } else -- 2.34.1