From: pcanterino <> Date: Fri, 22 Oct 2004 09:40:22 +0000 (+0000) Subject: Now we already unlock the file at the begining of exec_endedit(), because if an X-Git-Tag: version_2_1a~2 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/1574cddbc1107a6119116328e9696a65108f867b?hp=54dad5a0c7a0e11b30267db10353c162e680fcb5 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. --- 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