From: pcanterino <> Date: Sun, 10 Apr 2005 12:27:17 +0000 (+0000) Subject: Do not switch to binmode before saving a file or before showing the editing X-Git-Tag: version_3_0~44 X-Git-Url: https://git.p6c8.net/devedit.git/commitdiff_plain/83ec581a72a596bbf24c4988a46887aeb269001d?hp=aa2bc2bfca200e713a3a831192c992d78d782c47 Do not switch to binmode before saving a file or before showing the editing form. It caused a problem with the line endings. Let's hope it does not cause new problems... --- diff --git a/devedit.pl b/devedit.pl index 3eebb27..f2b3001 100644 --- a/devedit.pl +++ b/devedit.pl @@ -119,7 +119,7 @@ if(-e $temp_path || -l $temp_path) my $output = exec_command($command,\%data,$config); - # ... and show the output of the command + # ... and show its output print $$output; } diff --git a/modules/Command.pm b/modules/Command.pm index 7119349..c17383b 100644 --- a/modules/Command.pm +++ b/modules/Command.pm @@ -294,7 +294,7 @@ sub exec_beginedit($$) # ... and show the editing form - my $content = file_read($physical,1); + my $content = file_read($physical); my $md5sum = md5_hex($$content); $$content =~ s/\015\012|\012|\015/\n/g; @@ -362,7 +362,6 @@ sub exec_endedit($$) 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}) }; - binmode(FILE); my $md5 = new Digest::MD5; $md5->addfile(*FILE); @@ -527,8 +526,8 @@ sub exec_upload($$) return error($config->{'errors'}->{'file_exists'},$virtual,{FILE => $file_virt}) unless($cgi->param('overwrite')); } - my $ascii = $cgi->param('ascii'); - my $handle = $cgi->upload('uploaded_file'); + my $ascii = $cgi->param('ascii'); + my $handle = $cgi->upload('uploaded_file'); return error($config->{'errors'}->{'invalid_upload'},$virtual) unless($handle); @@ -648,8 +647,8 @@ sub exec_rename($$) my $dir = upper_path($virtual); my $new_physical = $data->{'new_physical'}; - return error($config->{'errors'}->{'rename_root'},'/') if($virtual eq '/'); - return error($config->{'errors'}->{'no_rename'},$dir) unless(-w upper_path($physical)); + return error($config->{'errors'}->{'rename_root'},'/') if($virtual eq '/'); + return error($config->{'errors'}->{'no_rename'},$dir) unless(-w upper_path($physical)); if($new_physical) {