Changeset 51fdc45


Ignore:
Timestamp:
2006-09-17T15:56:16Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8f243ad, 9544acb
Parents:
8320a7a
Message:

add_cr() is not used anymore, and HTML entity handling got UTFized some time
ago already, so no need for that FIXME comment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    r8320a7a r51fdc45  
    5454}
    5555
    56 char *add_cr(char *text)
    57 {
    58         char *ret = NULL;
    59         int count = 0, j;
    60         unsigned int i;
    61 
    62         if (text[0] == '\n')
    63                 count++;
    64         for (i = 1; i < strlen(text); i++)
    65                 if (text[i] == '\n' && text[i - 1] != '\r')
    66                         count++;
    67 
    68         if (count == 0)
    69                 return g_strdup(text);
    70 
    71         ret = g_malloc0(strlen(text) + count + 1);
    72 
    73         i = 0; j = 0;
    74         if (text[i] == '\n')
    75                 ret[j++] = '\r';
    76         ret[j++] = text[i++];
    77         for (; i < strlen(text); i++) {
    78                 if (text[i] == '\n' && text[i - 1] != '\r')
    79                         ret[j++] = '\r';
    80                 ret[j++] = text[i];
    81         }
    82 
    83         return ret;
    84 }
    85 
    8656char *normalize(const char *s)
    8757{
     
    12494typedef struct htmlentity
    12595{
    126         char code[8];
    127         char is[4];
     96        char code[7];
     97        char is[3];
    12898} htmlentity_t;
    129 
    130 /* FIXME: This is ISO8859-1(5) centric, so might cause problems with other charsets. */
    13199
    132100static const htmlentity_t ent[] =
Note: See TracChangeset for help on using the changeset viewer.