X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=init.c;h=21bdd4f255773d36d7a38fa66c6f712797a8ac92;hp=d4b367c753459113196e94a417c8b2466d697840;hb=f3cbb9f51357972f6e74244494236a41dc4d84cd;hpb=9fde23d2b9a4ba8076eb425a1af4342de1e485b5 diff --git a/init.c b/init.c index d4b367c..21bdd4f 100644 --- a/init.c +++ b/init.c @@ -206,7 +206,7 @@ static int num_from_string (struct option_t* dst, const char* val, num = strtol (val, &t, 0); - if (!*val || *t || (short) num != num) { + if (m_strisempty(val) || *t || (short) num != num) { if (errbuf) { snprintf (errbuf, errlen, _("'%s' is invalid for $%s"), val, dst->option); @@ -289,7 +289,7 @@ static int path_from_string (struct option_t* dst, const char* val, if (!dst) return (0); - if (!val || !*val) { + if (m_strisempty(val)) { p_delete((char**) dst->data); return (1); } @@ -423,7 +423,7 @@ static int rx_from_string (struct option_t* dst, const char* val, p = (rx_t*) dst->data; /* something to do? */ - if (!val || !*val || (p->pattern && m_strcmp(p->pattern, val) == 0)) + if (m_strisempty(val) || (p->pattern && m_strcmp(p->pattern, val) == 0)) return (1); if (m_strcmp(dst->option, "mask") != 0) @@ -476,7 +476,7 @@ static int magic_from_string (struct option_t* dst, const char* val, char* errbuf __attribute__ ((unused)), ssize_t errlen __attribute__ ((unused))) { int flag = -1; - if (!dst || !val || !*val) + if (!dst || m_strisempty(val)) return (0); if (ascii_strncasecmp (val, "mbox", 4) == 0) flag = M_MBOX; @@ -621,7 +621,7 @@ add_to_rx_list(rx_t **list, const char *s, int flags, BUFFER *err) { rx_t* rx; - if (!s || !*s) + if (m_strisempty(s)) return 0; if (rx_lookup(list, s)) @@ -642,7 +642,7 @@ static int add_to_spam_list(rx_t **list, const char *pat, { rx_t **last, *rx; - if (!pat || !*pat || !templ) + if (m_strisempty(pat) || !templ) return 0; if (!(rx = rx_compile (pat, REG_ICASE))) { @@ -798,7 +798,7 @@ static int parse_unignore (BUFFER * buf, BUFFER * s, mutt_extract_token (buf, s, 0); /* don't add "*" to the unignore list */ - if (strcmp (buf->data, "*")) + if (m_strcmp (buf->data, "*")) add_to_list (&UnIgnore, buf->data); remove_from_list (&Ignore, buf->data); @@ -1034,7 +1034,7 @@ static int parse_attach_list (BUFFER *buf, BUFFER *s, string_list_t **ldata, len = m_strlen(a->minor); tmpminor = p_new(char, len + 3); - strcpy(&tmpminor[1], a->minor); /* __STRCPY_CHECKED__ */ + m_strcpy(&tmpminor[1], len + 3, a->minor); tmpminor[0] = '^'; tmpminor[len+1] = '$'; tmpminor[len+2] = '\0'; @@ -1995,7 +1995,7 @@ static int source_rc (const char *rcfile, BUFFER * err) } p_delete(&token.data); p_delete(&linebuf); - fclose (f); + m_fclose(&f); if (pid != -1) mutt_wait_filter (pid); if (rc) { @@ -2505,7 +2505,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) else if (*buffer != '@') { Fqdn = p_new(char, m_strlen(buffer) + m_strlen(Hostname) + 2); - sprintf (Fqdn, "%s.%s", NONULL(Hostname), buffer); /* __SPRINTF_CHECKED__ */ + sprintf (Fqdn, "%s.%s", NONULL(Hostname), buffer); } else Fqdn = m_strdup(NONULL (Hostname)); @@ -2524,7 +2524,7 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) q++; *q = '\0'; NewsServer = m_strdup(p); - fclose (f); + m_fclose(&f); } } if ((p = getenv ("NNTPSERVER"))) @@ -2597,18 +2597,8 @@ void mutt_init (int skip_sys_rc, string_list_t * commands) mutt_init_history (); if (!Muttrc) { -#if 0 - snprintf (buffer, sizeof(buffer), "%s/.madmuttrc-%s", NONULL (Homedir), - MUTT_VERSION); - if (access (buffer, F_OK) == -1) -#endif snprintf (buffer, sizeof(buffer), "%s/.madmuttrc", NONULL (Homedir)); if (access (buffer, F_OK) == -1) -#if 0 - snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc-%s", - NONULL (Homedir), MUTT_VERSION); - if (access (buffer, F_OK) == -1) -#endif snprintf (buffer, sizeof(buffer), "%s/.madmutt/madmuttrc", NONULL (Homedir));