From b0bc06d050ec91ca312dd071acc40428a2e312d7 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sun, 11 Mar 2007 10:36:44 +0200 Subject: [PATCH] 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. --- src/bookmarks/backend/xbel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bookmarks/backend/xbel.c b/src/bookmarks/backend/xbel.c index f7042792..a7639290 100644 --- a/src/bookmarks/backend/xbel.c +++ b/src/bookmarks/backend/xbel.c @@ -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))