From: pcanterino <> Date: Sun, 10 Apr 2005 09:55:31 +0000 (+0000) Subject: - Locking did not work X-Git-Tag: version_3_0~46 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/a7a9dab8087e8b2e8b23721d2445d2058978d509?hp=8bc393b21655cb67a6c0bb7ef450b94c366e7aff - Locking did not work - Allow to save an empty file --- diff --git a/modules/Command.pm b/modules/Command.pm index edd0162..1d3b6e2 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: 2005-04-09 +# Last modified: 2005-04-10 # use strict; @@ -336,7 +336,7 @@ sub exec_endedit($$) my $md5sum = $cgi->param('md5sum'); my $output; - if($content && $md5sum) + if(defined $content && $md5sum) { # Normalize newlines @@ -361,7 +361,7 @@ sub exec_endedit($$) local *FILE; sysopen(FILE,$physical,O_RDWR | O_CREAT) or return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => $virtual}); - file_lock(FILE,LOCK_EX) or do { close(FILE); return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => $virtual}) }; + file_lock(*FILE,LOCK_EX) or do { close(FILE); return error($config->{'errors'}->{'edit_failed'},$dir,{FILE => $virtual}) }; binmode(FILE); my $md5 = new Digest::MD5;