1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-07-26 16:45:12 -04:00

Fix perl pre_format_html hook wrt. binary files

When trying to view a binary file, this hook would cut it at the first
'\0'.
This commit is contained in:
Petr Baudis 2006-11-03 19:22:58 +01:00 committed by Petr Baudis
parent b8d8d27df4
commit 5af21a8d29

View File

@ -135,13 +135,13 @@ do_script_hook_pre_format_html(unsigned char *url, struct cache_entry *cached,
if (SvTRUE(ERRSV)) count = 0; /* FIXME: error message ? */
SPAGAIN;
if (count == 1) {
unsigned char *new_html = POPpx;
SV *new_html_sv = POPs;
int new_html_len;
unsigned char *new_html = SvPV(new_html_sv, new_html_len);
if (new_html) {
int len = strlen(new_html);
add_fragment(cached, 0, new_html, len);
normalize_cache_entry(cached, len);
add_fragment(cached, 0, new_html, new_html_len);
normalize_cache_entry(cached, new_html_len);
}
}