webtgz.pl wasn't handling escaped data in downloaded file contents.

This was causing problems for binary files.
This commit is contained in:
Bruno Wolff III 2005-10-17 13:03:08 +00:00
parent 0b9eb81e2a
commit 3d7ae7bd28
2 changed files with 13 additions and 1 deletions

View file

@ -80,6 +80,8 @@ SVN trunk:
* I fixed a bug in how the language list was sorted on the web page
* Updated webtgz.pl to do a couple of undefines before starting the copy of
the cached campaign, to give perl a chance to release some memory.
* Fixed a bug in webtgz.pl where it wasn't handling escaped data in
downloaded files.
* fix untranslated unit create dialog (#4424)
* random map generator now uses island_size (#4458)
* various bug fixes and code cleanups

View file

@ -332,7 +332,17 @@ sub archive_dir
else {
$filename = "$path/" . $file->{'attr'}->{'name'};
}
$archive->add_data($filename, $file->{'attr'}->{'contents'},
my @contents = split(//, $file->{'attr'}->{'contents'});
my $contents = '';
while(@contents) {
my $char = shift @contents;
if (1 == ord $char) {
$char = chr(ord(shift @contents) - 1);
}
$contents .= $char;
}
$archive->add_data($filename, $contents,
{'uname'=>'root', 'gname'=>'root', 'uid'=>0, 'gid'=>0, 'mode'=>0644});
}
}