1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

XBEL: Fix us-ascii charset lookup.

Previously, print_xml_entities did look up the charset, but did not
save the result anywhere and just used 0, leading to further lookups
in subsequent calls.  It worked by accident though, because the
codepage index of us-ascii currently is 0.

[ Backported from commit e325b748be
  in ELinks 0.12.GIT.  --KON ]
This commit is contained in:
Kalle Olavi Niemitalo 2007-03-11 10:36:44 +02:00 committed by Kalle Olavi Niemitalo
parent fe886d198d
commit 0286a66c98

View File

@ -183,9 +183,9 @@ print_xml_entities(struct secure_save_info *ssi, const unsigned char *str)
|| (x) == '{' || (x) == '%' \
|| (x) == '+')
static int cp = 0;
static int cp = -1;
if (!cp) get_cp_index("us-ascii");
if (cp == -1) cp = get_cp_index("us-ascii");
for (; *str; str++) {
if (accept_char(*str))