2005-01-14 [colin] 0.9.13cvs33.1
authorColin Leroy <colin@colino.net>
Fri, 14 Jan 2005 13:05:38 +0000 (13:05 +0000)
committerColin Leroy <colin@colino.net>
Fri, 14 Jan 2005 13:05:38 +0000 (13:05 +0000)
* src/html.c
* src/msgcache.c
Sync with HEAD

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/html.c
src/msgcache.c

index 606180d263bcf4a7478a5c15440e698fb8f7d046..9cb8d5f66b01fd6a95caedcdedef68d5f3b98017 100644 (file)
@@ -1,3 +1,9 @@
+2005-01-14 [colin]     0.9.13cvs33.1
+
+       * src/html.c
+       * src/msgcache.c
+               Sync with HEAD
+
 2005-01-14 [colin]     0.9.13cvs32.1
 
        * src/html.c
index 9f53b051012ab96d0ca00cc1aa345a73bcaa8e2e..52cd9486b075bee270738ced00d716ab9974c8d6 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.396.2.18 -r 1.396.2.19 ChangeLog; cvs diff -u -r 1.2504.2.41 -r 1.2504.2.42 ChangeLog.claws; cvs diff -u -r 1.391.2.18 -r 1.391.2.19 ChangeLog.jp; cvs diff -u -r 1.654.2.351 -r 1.654.2.352 configure.ac; cvs diff -u -r 1.56.2.31 -r 1.56.2.32 src/pop.c; cvs diff -u -r 1.17.2.13 -r 1.17.2.14 src/pop.h; ) > 0.9.13cvs29.1.patchset
 ( cvs diff -u -r 1.1.4.9 -r 1.1.4.10 src/prefs_filtering_action.c; cvs diff -u -r 1.59.2.12 -r 1.59.2.13 src/prefs_filtering.c; ) > 0.9.13cvs29.2.patchset
 ( cvs diff -u -r 1.12.2.3 -r 1.12.2.4 src/html.c; cvs diff -u -r 1.3 -r 1.4 src/html.h; cvs diff -u -r 1.16.2.11 -r 1.16.2.12 src/msgcache.c; cvs diff -u -r 1.100.2.10 -r 1.100.2.11 AUTHORS; cvs diff -u -r 1.1 -r 1.2 tools/calypso_convert.pl; ) > 0.9.13cvs32.1.patchset
+( cvs diff -u -r 1.12.2.4 -r 1.12.2.5 src/html.c; cvs diff -u -r 1.16.2.12 -r 1.16.2.13 src/msgcache.c; ) > 0.9.13cvs33.1.patchset
index 904187e3f74f7e39916f377a91522af9e2f1b3d9..c27d13df20e5e28a2cb8fcbacccec5182da8b30d 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=32
+EXTRA_VERSION=33
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=.1
 
index 597423678fb79e1a61cbe97106ab5cb2d2e83c3f..f38fcebdbdd1f1d02bc1937d502c4dfbc3338a91 100644 (file)
@@ -413,8 +413,9 @@ gchar *html_parse(HTMLParser *parser)
                         * see the end anchor tag
                         */
                        if (HTML_HREF_BEG == st || HTML_HREF == st)
-                           return parser->str->str;
-                       } break;
+                               return parser->str->str;
+                       } 
+                       break;
                case '&':
                        html_parse_special(parser);
                        break;
@@ -734,68 +735,88 @@ static void html_parse_special(HTMLParser *parser)
                        parser->state = HTML_NORMAL;
                        return;
                } else {
-                   char *symb = NULL;
-                   switch (ch) {
-                   /* http://www.w3schools.com/html/html_entitiesref.asp */
-                   case 338:   /* capital ligature OE  &OElig;  */
-                       symb = "OE";  break;
-                   case 339:   /* small ligature OE    &oelig;  */
-                       symb = "oe";  break;
-                   case 352:   /* capital S w/caron    &Scaron; */
-                   case 353:   /* small S w/caron      &scaron; */
-                   case 376:   /* cap Y w/ diaeres     &Yuml;   */
-                       break;
-                   case 710:   /* circumflex accent    &circ;   */
-                       symb = "^";  break;
-                   case 732:   /* small tilde          &tilde;  */
-                       symb = "~";  break;
-                   case 8194:  /* en space             &ensp;   */
-                   case 8195:  /* em space             &emsp;   */
-                   case 8201:  /* thin space           &thinsp; */
-                       symb = " ";  break;
-                   case 8204:  /* zero width non-joiner &zwnj;  */
-                   case 8205:  /* zero width joiner    &zwj;    */
-                   case 8206:  /* l-t-r mark           &lrm;    */
-                   case 8207:  /* r-t-l mark           &rlm     */
-                       break;
-                   case 8211:  /* en dash              &ndash;  */
-                       symb = "-";  break;
-                   case 8212:  /* em dash              &mdash;  */
-                       symb = "--";  break;
-                   case 8216:  /* l single quot mark   &lsquo;  */
-                       symb = "`";  break;
-                   case 8217:  /* r single quot mark   &rsquo;  */
-                       symb = "'";  break;
-                   case 8218:  /* single low-9 quot    &sbquo;  */
-                       symb = ",";  break;
-                   case 8220:  /* l double quot mark   &ldquo;  */
-                       symb = "``";  break;
-                   case 8221:  /* r double quot mark   &rdquo;  */
-                       symb = "''";  break;
-                   case 8222:  /* double low-9 quot    &bdquo;  */
-                       symb = ",,";  break;
-                   case 8224:  /* dagger               &dagger; */
-                   case 8225:  /* double dagger        &Dagger; */
-                       break;
-                   case 8230:  /* horizontal ellipsis  &hellip; */
-                       symb = "...";  break;
-                   case 8240:  /* per mile             &permil; */
-                       symb = "\%o";  break;
-                   case 8249:  /* l-pointing angle quot &lsaquo; */
-                       symb = "<";  break;
-                   case 8250:  /* r-pointing angle quot &rsaquo; */
-                       symb = ">";  break;
-                   case 8364:  /* euro                 &euro;   */
-                       symb = "&euro";  break;
-                   case 8482:  /* trademark            &trade;  */
-                       symb  = "(TM)";  break;
-                   default: break;
-                   }
-                   if (symb) {
-                       html_append_str(parser, symb, -1);
-                       parser->state = HTML_NORMAL;
-                       return;
-                   }
+                       char *symb = NULL;
+                       switch (ch) {
+                       /* http://www.w3schools.com/html/html_entitiesref.asp */
+                       case 338:       /* capital ligature OE  &OElig;  */
+                               symb = "OE";  
+                               break;
+                       case 339:       /* small ligature OE    &oelig;  */
+                               symb = "oe";  
+                               break;
+                       case 352:       /* capital S w/caron    &Scaron; */
+                       case 353:       /* small S w/caron      &scaron; */
+                       case 376:       /* cap Y w/ diaeres     &Yuml;   */
+                               break;
+                       case 710:       /* circumflex accent    &circ;   */
+                               symb = "^";  
+                               break;
+                       case 732:       /* small tilde          &tilde;  */
+                               symb = "~";  
+                               break;
+                       case 8194:      /* en space             &ensp;   */
+                       case 8195:      /* em space             &emsp;   */
+                       case 8201:      /* thin space           &thinsp; */
+                               symb = " ";  
+                               break;
+                       case 8204:      /* zero width non-joiner &zwnj;  */
+                       case 8205:      /* zero width joiner    &zwj;   */
+                       case 8206:      /* l-t-r mark           &lrm;   */
+                       case 8207:      /* r-t-l mark           &rlm     */
+                               break;
+                       case 8211:      /* en dash              &ndash;  */
+                               symb = "-";  
+                               break;
+                       case 8212:      /* em dash              &mdash;  */
+                               symb = "--";  
+                               break;
+                       case 8216:      /* l single quot mark   &lsquo;  */
+                               symb = "`";  
+                               break;
+                       case 8217:      /* r single quot mark   &rsquo;  */
+                               symb = "'";  
+                               break;
+                       case 8218:      /* single low-9 quot    &sbquo;  */
+                               symb = ",";  
+                               break;
+                       case 8220:      /* l double quot mark   &ldquo;  */
+                               symb = "``";  
+                               break;
+                       case 8221:      /* r double quot mark   &rdquo;  */
+                               symb = "''";  
+                               break;
+                       case 8222:      /* double low-9 quot    &bdquo;  */
+                               symb = ",,";  
+                               break;
+                       case 8224:      /* dagger               &dagger; */
+                       case 8225:      /* double dagger        &Dagger; */
+                               break;
+                       case 8230:      /* horizontal ellipsis  &hellip; */
+                               symb = "...";  
+                               break;
+                       case 8240:      /* per mile             &permil; */
+                               symb = "\%o";  
+                               break;
+                       case 8249:      /* l-pointing angle quot &lsaquo; */
+                               symb = "<";  
+                               break;
+                       case 8250:      /* r-pointing angle quot &rsaquo; */
+                               symb = ">";  
+                               break;
+                       case 8364:      /* euro                 &euro;   */
+                               symb = "EUR";  
+                               break;
+                       case 8482:      /* trademark            &trade;  */
+                               symb  = "(TM)";  
+                               break;
+                       default: 
+                               break;
+                       }
+                       if (symb) {
+                               html_append_str(parser, symb, -1);
+                               parser->state = HTML_NORMAL;
+                               return;
+                       }
                }
        }
 
index 6167d2df4b3ab262d371b26260ddc2db773ed40c..56d360fc59343def4d2b37219ea1a34418bcf9a4 100644 (file)
@@ -239,8 +239,9 @@ gint msgcache_get_memory_usage(MsgCache *cache)
        guint32 idata; \
        size_t ni; \
  \
-       if (sizeof(idata) != (ni = fread(&idata, 1, sizeof(idata), fp))) { \
-               g_warning("read_int: Cache data corrupted, read %d of %d at offset %d\n", ni, sizeof(idata), ftell(fp)); \
+       if ((ni = fread(&idata, 1, sizeof(idata), fp)) != sizeof(idata)) { \
+               g_warning("read_int: Cache data corrupted, read %d of %d at " \
+                         "offset %d\n", ni, sizeof(idata), ftell(fp)); \
                procmsg_msginfo_free(msginfo); \
                error = TRUE; \
                break; \
@@ -323,39 +324,43 @@ static FILE *msgcache_open_data_file(const gchar *file, gint version,
        return fp;
 }
 
-static gint 
-msgcache_read_cache_data_str(FILE *fp, gchar **str, StringConverter *conv)
+static gint msgcache_read_cache_data_str(FILE *fp, gchar **str, 
+                                        StringConverter *conv)
 {
-    gchar *tmpstr = NULL;
-    size_t ni;
-    guint32 len;
-
-    *str = NULL;
-    if (sizeof(len) != (ni = fread(&len, 1, sizeof(len), fp))
-       || len > G_MAXINT) {
-       g_warning("read_data_str: Cache data (len) corrupted, read %d of %d bytes at offset %d\n", 
-               ni, sizeof(len), ftell(fp));
-       return -1;
-    }
-    if (0 == len)
+       gchar *tmpstr = NULL;
+       size_t ni;
+       guint32 len;
+
+       *str = NULL;
+       if ((ni = fread(&len, 1, sizeof(len), fp) != sizeof(len)) ||
+           len > G_MAXINT) {
+               g_warning("read_data_str: Cache data (len) corrupted, read %d "
+                         "of %d bytes at offset %d\n", ni, sizeof(len), 
+                         ftell(fp));
+               return -1;
+       }
+
+       if (len == 0)
+               return 0;
+
+       tmpstr = g_malloc(len + 1);
+
+       if ((ni = fread(tmpstr, 1, len, fp)) != len) {
+               g_warning("read_data_str: Cache data corrupted, read %d of %d "
+                         "bytes at offset %d\n", 
+                         ni, len, ftell(fp));
+               g_free(tmpstr);
+               return -1;
+       }
+       tmpstr[len] = 0;
+
+       if (conv != NULL) {
+               *str = conv->convert(conv, tmpstr);
+               g_free(tmpstr);
+       } else 
+               *str = tmpstr;
+
        return 0;
-    tmpstr = g_malloc(len + 1);
-
-    if (len != (ni = fread(tmpstr, 1, len, fp))) {
-       g_warning("read_data_str: Cache data corrupted, read %d of %d bytes at offset %d\n", 
-               ni, len, ftell(fp));
-       g_free(tmpstr);
-       return -1;
-    }
-    tmpstr[len] = 0;
-
-    if (conv != NULL) {
-           *str = conv->convert(conv, tmpstr);
-           g_free(tmpstr);
-    } else 
-           *str = tmpstr;
-
-    return 0;
 }
 
 gchar *strconv_strdup_convert(StringConverter *conv, gchar *srcstr)