From a7a9dab8087e8b2e8b23721d2445d2058978d509 Mon Sep 17 00:00:00 2001 From: pcanterino <> Date: Sun, 10 Apr 2005 09:55:31 +0000 Subject: [PATCH] - Locking did not work - Allow to save an empty file --- modules/Command.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 2.34.1