From 51fdc4512cc77fd6b59b582f27887657d7c3721e Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 17 Sep 2006 17:56:16 +0200 Subject: add_cr() is not used anymore, and HTML entity handling got UTFized some time ago already, so no need for that FIXME comment. --- lib/misc.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'lib') diff --git a/lib/misc.c b/lib/misc.c index 17599946..64666492 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -53,36 +53,6 @@ void strip_linefeed(gchar *text) g_free(text2); } -char *add_cr(char *text) -{ - char *ret = NULL; - int count = 0, j; - unsigned int i; - - if (text[0] == '\n') - count++; - for (i = 1; i < strlen(text); i++) - if (text[i] == '\n' && text[i - 1] != '\r') - count++; - - if (count == 0) - return g_strdup(text); - - ret = g_malloc0(strlen(text) + count + 1); - - i = 0; j = 0; - if (text[i] == '\n') - ret[j++] = '\r'; - ret[j++] = text[i++]; - for (; i < strlen(text); i++) { - if (text[i] == '\n' && text[i - 1] != '\r') - ret[j++] = '\r'; - ret[j++] = text[i]; - } - - return ret; -} - char *normalize(const char *s) { static char buf[BUF_LEN]; @@ -123,12 +93,10 @@ time_t get_time(int year, int month, int day, int hour, int min, int sec) typedef struct htmlentity { - char code[8]; - char is[4]; + char code[7]; + char is[3]; } htmlentity_t; -/* FIXME: This is ISO8859-1(5) centric, so might cause problems with other charsets. */ - static const htmlentity_t ent[] = { { "lt", "<" }, -- cgit v1.2.3