projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
exit str_cmp enters m_strcmp
[apps/madmutt.git]
/
nntp
/
newsrc.c
diff --git
a/nntp/newsrc.c
b/nntp/newsrc.c
index
d3d9a6c
..
22b6cf3
100644
(file)
--- a/
nntp/newsrc.c
+++ b/
nntp/newsrc.c
@@
-14,6
+14,7
@@
#endif
#include <lib-lib/mem.h>
#endif
#include <lib-lib/mem.h>
+#include <lib-lib/str.h>
#include <lib-lib/macros.h>
#include "mutt.h"
#include <lib-lib/macros.h>
#include "mutt.h"
@@
-26,7
+27,6
@@
#include "rfc1524.h"
#include "rfc2047.h"
#include "rfc1524.h"
#include "rfc2047.h"
-#include "lib/str.h"
#include "lib/debug.h"
#include <unistd.h>
#include "lib/debug.h"
#include <unistd.h>
@@
-75,7
+75,7
@@
static int nntp_parse_newsrc_line (NNTP_SERVER * news, char *line)
len = sizeof (group);
strfcpy (group, line, len);
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
len = sizeof (group);
strfcpy (group, line, len);
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, group)) == NULL) {
- data = xmalloc(sizeof(NNTP_DATA) +
str_
len(group) + 1);
+ data = xmalloc(sizeof(NNTP_DATA) +
m_str
len(group) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
@@
-206,7
+206,7
@@
static int nntp_parse_cacheindex (NNTP_SERVER * news)
return 0;
rewind (index);
while (fgets (buf, sizeof (buf), index)) {
return 0;
rewind (index);
while (fgets (buf, sizeof (buf), index)) {
- buf[
str_len
(buf) - 1] = 0; /* strip ending '\n' */
+ buf[
m_strlen
(buf) - 1] = 0; /* strip ending '\n' */
if (!str_ncmp (buf, "#: ", 3) &&
!str_casecmp (buf + 3, news->conn->account.host))
break;
if (!str_ncmp (buf, "#: ", 3) &&
!str_casecmp (buf + 3, news->conn->account.host))
break;
@@
-218,16
+218,16
@@
static int nntp_parse_cacheindex (NNTP_SERVER * news)
if (!*cp)
continue;
cp[0] = 0;
if (!*cp)
continue;
cp[0] = 0;
- if (!
str_cmp
(buf, "#:"))
+ if (!
m_strcmp
(buf, "#:"))
break;
sscanf (cp + 1, "%s %d %d", file, &l, &m);
break;
sscanf (cp + 1, "%s %d %d", file, &l, &m);
- if (!
str_cmp
(buf, "ALL")) {
- news->cache =
str_dup
(file);
+ if (!
m_strcmp
(buf, "ALL")) {
+ news->cache =
m_strdup
(file);
news->newgroups_time = m;
}
else if (news->newsgroups) {
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
news->newgroups_time = m;
}
else if (news->newsgroups) {
if ((data = (NNTP_DATA *) hash_find (news->newsgroups, buf)) == NULL) {
- data = xmalloc(sizeof(NNTP_DATA) +
str_
len(buf) + 1);
+ data = xmalloc(sizeof(NNTP_DATA) +
m_str
len(buf) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, buf);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, buf);
data->nserv = news;
@@
-238,7
+238,7
@@
static int nntp_parse_cacheindex (NNTP_SERVER * news)
hash_insert (news->newsgroups, data->group, data, 0);
nntp_add_to_list (news, data);
}
hash_insert (news->newsgroups, data->group, data, 0);
nntp_add_to_list (news, data);
}
- data->cache =
str_dup
(file);
+ data->cache =
m_strdup
(file);
t = 0;
if (!data->firstMessage || data->lastMessage < m)
t = 1;
t = 0;
if (!data->firstMessage || data->lastMessage < m)
t = 1;
@@
-287,7
+287,7
@@
int nntp_parse_url (const char *server, ACCOUNT * acct,
acct->port = NNTP_PORT;
acct->type = M_ACCT_TYPE_NNTP;
acct->port = NNTP_PORT;
acct->type = M_ACCT_TYPE_NNTP;
- c =
str_dup
(server);
+ c =
m_strdup
(server);
url_parse_ciss (&url, c);
if (url.scheme == U_NNTP || url.scheme == U_NNTPS) {
url_parse_ciss (&url, c);
if (url.scheme == U_NNTP || url.scheme == U_NNTPS) {
@@
-311,7
+311,7
@@
void nntp_expand_path (char *line, size_t len, ACCOUNT * acct)
{
ciss_url_t url;
{
ciss_url_t url;
- url.path =
str_dup
(line);
+ url.path =
m_strdup
(line);
mutt_account_tourl (acct, &url);
url_ciss_tostring (&url, line, len, 0);
p_delete(&url.path);
mutt_account_tourl (acct, &url);
url_ciss_tostring (&url, line, len, 0);
p_delete(&url.path);
@@
-336,7
+336,7
@@
NNTP_SERVER *mutt_select_newsserver (char *server)
NNTP_SERVER *serv;
CONNECTION *conn;
NNTP_SERVER *serv;
CONNECTION *conn;
-
memset (&acct, 0, sizeof (ACCOUNT)
);
+
p_clear(&acct, 1
);
if (!server || !*server) {
mutt_error _("No newsserver defined!");
if (!server || !*server) {
mutt_error _("No newsserver defined!");
@@
-344,7
+344,7
@@
NNTP_SERVER *mutt_select_newsserver (char *server)
return NULL;
}
return NULL;
}
- buf = p = p_new(char,
str_len
(server) + 10);
+ buf = p = p_new(char,
m_strlen
(server) + 10);
if (url_check_scheme (server) == U_UNKNOWN) {
strcpy (buf, "nntp://");
p = strchr (buf, '\0');
if (url_check_scheme (server) == U_UNKNOWN) {
strcpy (buf, "nntp://");
p = strchr (buf, '\0');
@@
-396,7
+396,7
@@
NNTP_SERVER *mutt_select_newsserver (char *server)
/* New newsserver */
serv = p_new(NNTP_SERVER, 1);
serv->conn = conn;
/* New newsserver */
serv = p_new(NNTP_SERVER, 1);
serv->conn = conn;
- serv->newsrc =
str_dup
(file);
+ serv->newsrc =
m_strdup
(file);
serv->newsgroups = hash_create (1009);
slurp_newsrc (serv); /* load .newsrc */
nntp_parse_cacheindex (serv); /* load .index */
serv->newsgroups = hash_create (1009);
slurp_newsrc (serv); /* load .newsrc */
nntp_parse_cacheindex (serv); /* load .index */
@@
-513,8
+513,8
@@
static void nntp_create_newsrc_line (NNTP_DATA * data, char **buf,
line = *buf + (*pline - line);
}
strcpy (line, data->group);
line = *buf + (*pline - line);
}
strcpy (line, data->group);
- len -=
str_len
(line) + 1;
- line +=
str_len
(line);
+ len -=
m_strlen
(line) + 1;
+ line +=
m_strlen
(line);
*line++ = data->subscribed ? ':' : '!';
*line++ = ' ';
*line = '\0';
*line++ = data->subscribed ? ':' : '!';
*line++ = ' ';
*line = '\0';
@@
-760,7
+760,7
@@
int mutt_newsrc_update (NNTP_SERVER * news)
continue;
nntp_create_newsrc_line (data, &buf, &line, &llen);
debug_print (2, ("Added to newsrc: %s\n", line));
continue;
nntp_create_newsrc_line (data, &buf, &line, &llen);
debug_print (2, ("Added to newsrc: %s\n", line));
- line +=
str_len
(line);
+ line +=
m_strlen
(line);
}
/* newrc being fully rewritten */
if (news->newsrc &&
}
/* newrc being fully rewritten */
if (news->newsrc &&
@@
-786,7
+786,7
@@
static FILE *mutt_mkname (char *s)
return fp;
nntp_cache_expand (buf, "cache-XXXXXX");
return fp;
nntp_cache_expand (buf, "cache-XXXXXX");
- pc = buf +
str_len
(buf) - 12; /* positioning to "cache-XXXXXX" */
+ pc = buf +
m_strlen
(buf) - 12; /* positioning to "cache-XXXXXX" */
if ((fd = mkstemp (buf)) == -1)
return NULL;
strcpy (s, pc); /* generated name */
if ((fd = mkstemp (buf)) == -1)
return NULL;
strcpy (s, pc); /* generated name */
@@
-856,7
+856,7
@@
int nntp_save_cache_index (NNTP_SERVER * news)
else {
strfcpy (buf, news->conn->account.host, sizeof (buf));
f = mutt_mkname (buf);
else {
strfcpy (buf, news->conn->account.host, sizeof (buf));
f = mutt_mkname (buf);
- news->cache =
str_dup
(buf);
+ news->cache =
m_strdup
(buf);
nntp_cache_expand (file, buf);
}
if (!f)
nntp_cache_expand (file, buf);
}
if (!f)
@@
-912,7
+912,7
@@
int nntp_save_cache_group (CONTEXT * ctx)
((NNTP_DATA *) ctx->data)->nserv->conn->account.host,
((NNTP_DATA *) ctx->data)->group);
f = mutt_mkname (buf);
((NNTP_DATA *) ctx->data)->nserv->conn->account.host,
((NNTP_DATA *) ctx->data)->group);
f = mutt_mkname (buf);
- ((NNTP_DATA *) ctx->data)->cache =
str_dup
(buf);
+ ((NNTP_DATA *) ctx->data)->cache =
m_strdup
(buf);
nntp_cache_expand (file, buf);
}
if (!f)
nntp_cache_expand (file, buf);
}
if (!f)
@@
-992,7
+992,7
@@
NNTP_DATA *mutt_newsgroup_subscribe (NNTP_SERVER * news, char *group)
if (!news || !news->newsgroups || !group || !*group)
return NULL;
if (!(data = (NNTP_DATA *) hash_find (news->newsgroups, group))) {
if (!news || !news->newsgroups || !group || !*group)
return NULL;
if (!(data = (NNTP_DATA *) hash_find (news->newsgroups, group))) {
- data = xmalloc(sizeof(NNTP_DATA) +
str_
len(group) + 1);
+ data = xmalloc(sizeof(NNTP_DATA) +
m_str
len(group) + 1);
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
data->group = (char *) data + sizeof (NNTP_DATA);
strcpy (data->group, group);
data->nserv = news;
@@
-1085,7
+1085,7
@@
void nntp_buffy (char* dst, size_t dstlen) {
NNTP_DATA *data = (NNTP_DATA *) list->data;
if (data && data->subscribed && data->unread &&
Context && Context->magic == M_NNTP &&
NNTP_DATA *data = (NNTP_DATA *) list->data;
if (data && data->subscribed && data->unread &&
Context && Context->magic == M_NNTP &&
-
str_cmp
(data->group, ((NNTP_DATA *) Context->data)->group) == 0) {
+
m_strcmp
(data->group, ((NNTP_DATA *) Context->data)->group) == 0) {
list = list->next;
break;
}
list = list->next;
break;
}
@@
-1103,7
+1103,7
@@
void nntp_buffy (char* dst, size_t dstlen) {
if (data && data->subscribed && data->unread) {
if (Context && Context->magic == M_NNTP &&
if (data && data->subscribed && data->unread) {
if (Context && Context->magic == M_NNTP &&
- !
str_cmp
(data->group, ((NNTP_DATA *) Context->data)->group)) {
+ !
m_strcmp
(data->group, ((NNTP_DATA *) Context->data)->group)) {
unsigned int i, unread = 0;
for (i = 0; i < Context->msgcount; i++)
unsigned int i, unread = 0;
for (i = 0; i < Context->msgcount; i++)