X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=nntp%2Fnewsrc.c;h=4dadc20ab85d09d0fafadb500c0e8861e1c7c9e3;hb=7048f7d738dac900f2e76622f3d92b62f99b69a7;hp=10a539f02c4b4bccff3ba79597cd288553ce3694;hpb=b08f9bb863302b8a1e2c1ebb3d4f2be00f6bd759;p=apps%2Fmadmutt.git diff --git a/nntp/newsrc.c b/nntp/newsrc.c index 10a539f..4dadc20 100644 --- a/nntp/newsrc.c +++ b/nntp/newsrc.c @@ -18,12 +18,16 @@ #include "sort.h" #include "mx.h" #include "mime.h" -#include "mailbox.h" #include "nntp.h" #include "rfc822.h" #include "rfc1524.h" #include "rfc2047.h" +#include "lib/mem.h" +#include "lib/str.h" +#include "lib/intl.h" +#include "lib/debug.h" + #include #include #include @@ -121,7 +125,7 @@ static int nntp_parse_newsrc_line (NNTP_SERVER * news, char *line) data->lastMessage = data->entries[x - 1].last; data->num = x; mutt_newsgroup_stat (data); - dprint (2, (debugfile, "parse_line: Newsgroup %s\n", data->group)); + debug_print (2, ("Newsgroup %s\n", data->group)); return 0; } @@ -202,8 +206,8 @@ static int nntp_parse_cacheindex (NNTP_SERVER * news) rewind (index); while (fgets (buf, sizeof (buf), index)) { buf[mutt_strlen (buf) - 1] = 0; /* strip ending '\n' */ - if (!mutt_strncmp (buf, "#: ", 3) && - !mutt_strcasecmp (buf + 3, news->conn->account.host)) + if (!safe_strncmp (buf, "#: ", 3) && + !safe_strcasecmp (buf + 3, news->conn->account.host)) break; } while (fgets (buf, sizeof (buf), index)) { @@ -262,7 +266,7 @@ const char *nntp_format_str (char *dest, size_t destlen, char op, switch (op) { case 's': strncpy (fn, NewsServer, sizeof (fn) - 1); - mutt_strlower (fn); + str_tolower (fn); snprintf (tmp, sizeof (tmp), "%%%ss", fmt); snprintf (dest, destlen, tmp, fn); break; @@ -434,7 +438,7 @@ void nntp_get_status (CONTEXT * ctx, HEADER * h, char *group, int article) if (!data) { #ifdef DEBUG if (group) - dprint (3, (debugfile, "newsgroup %s not found\n", group)); + debug_print (3, ("newsgroup %s not found\n", group)); #endif return; } @@ -641,7 +645,7 @@ int mutt_newsrc_update (NNTP_SERVER * news) if (!data || !data->rc) continue; nntp_create_newsrc_line (data, &buf, &line, &llen); - dprint (2, (debugfile, "Added to newsrc: %s", line)); + debug_print (2, ("Added to newsrc: %s\n", line)); line += mutt_strlen (line); } /* newrc being fully rewritten */ @@ -712,7 +716,7 @@ void nntp_clear_cacheindex (NNTP_SERVER * news) if (!data || data->subscribed || !data->cache) continue; nntp_delete_cache (data); - dprint (2, (debugfile, "Removed from .index: %s\n", data->group)); + debug_print (2, ("Removed from .index: %s\n", data->group)); } return; }