diff options
-rw-r--r-- | alias.c | 2 | ||||
-rw-r--r-- | bcache.c | 2 | ||||
-rw-r--r-- | charset.c | 2 | ||||
-rw-r--r-- | commands.c | 4 | ||||
-rw-r--r-- | compose.c | 3 | ||||
-rw-r--r-- | crypt-gpgme.c | 8 | ||||
-rw-r--r-- | crypt.c | 4 | ||||
-rw-r--r-- | curs_main.c | 2 | ||||
-rw-r--r-- | handler.c | 2 | ||||
-rw-r--r-- | hcache.c | 3 | ||||
-rw-r--r-- | hook.c | 2 | ||||
-rw-r--r-- | imap/auth.c | 2 | ||||
-rw-r--r-- | imap/auth_oauth.c | 2 | ||||
-rw-r--r-- | init.c | 2 | ||||
-rw-r--r-- | mutt_socket.c | 2 | ||||
-rw-r--r-- | muttlib.c | 2 | ||||
-rw-r--r-- | parse.c | 4 | ||||
-rw-r--r-- | pgpinvoke.c | 4 | ||||
-rw-r--r-- | pop_auth.c | 4 | ||||
-rw-r--r-- | rfc1524.c | 2 | ||||
-rw-r--r-- | rfc2047.c | 6 | ||||
-rw-r--r-- | rfc2231.c | 2 | ||||
-rw-r--r-- | send.c | 6 | ||||
-rw-r--r-- | sendlib.c | 14 | ||||
-rw-r--r-- | smime.c | 6 | ||||
-rw-r--r-- | smtp.c | 2 |
26 files changed, 45 insertions, 49 deletions
@@ -215,7 +215,7 @@ static void recode_buf (char *buf, size_t buflen) { char *s; - if (!ConfigCharset || !*ConfigCharset || !Charset) + if (!ConfigCharset || !Charset) return; s = safe_strdup (buf); if (!s) @@ -46,7 +46,7 @@ static int bcache_path(ACCOUNT *account, const char *mailbox, ciss_url_t url; int len; - if (!account || !MessageCachedir || !*MessageCachedir || !dst || !dstlen) + if (!account || !MessageCachedir || !dst || !dstlen) return -1; /* make up a ciss_url_t we can turn into a string */ @@ -317,7 +317,7 @@ char *mutt_get_default_charset () const char *c = AssumedCharset; const char *c1; - if (c && *c) + if (c) { c1 = strchr (c, ':'); strfcpy (fcharset, c, c1 ? (c1 - c + 1) : sizeof (fcharset)); @@ -194,7 +194,7 @@ int mutt_display_message (HEADER *cur) return (0); } - if (DisplayFilter && *DisplayFilter) + if (DisplayFilter) { fpfilterout = fpout; fpout = NULL; @@ -585,7 +585,7 @@ void mutt_pipe_message (HEADER *h) void mutt_print_message (HEADER *h) { - if (quadoption (OPT_PRINT) && (!PrintCmd || !*PrintCmd)) + if (quadoption (OPT_PRINT) && !PrintCmd) { mutt_message (_("No printing command has been defined.")); return; @@ -260,8 +260,7 @@ static void redraw_crypt_lines (HEADER *msg) if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME) && (msg->security & ENCRYPT) - && SmimeCryptAlg - && *SmimeCryptAlg) + && SmimeCryptAlg) { SETCOLOR (MT_COLOR_COMPOSE_HEADER); mutt_window_mvprintw (MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: ")); diff --git a/crypt-gpgme.c b/crypt-gpgme.c index 696daa62..bbdede5f 100644 --- a/crypt-gpgme.c +++ b/crypt-gpgme.c @@ -943,11 +943,11 @@ static int set_signer (gpgme_ctx_t ctx, int for_smime) char *fpr, *fpr2; if (for_smime) - signid = (SmimeSignAs && *SmimeSignAs) ? SmimeSignAs : SmimeDefaultKey; + signid = SmimeSignAs ? SmimeSignAs : SmimeDefaultKey; else - signid = (PgpSignAs && *PgpSignAs) ? PgpSignAs : PgpDefaultKey; + signid = PgpSignAs ? PgpSignAs : PgpDefaultKey; - if (!signid || !*signid) + if (!signid) return 0; listctx = create_gpgme_context (for_smime); @@ -2319,7 +2319,7 @@ static int pgp_gpgme_extract_keys (gpgme_data_t keydata, FILE** fp) if (legacy_api) { - snprintf (tmpdir, sizeof(tmpdir), "%s/mutt-gpgme-XXXXXX", Tempdir); + snprintf (tmpdir, sizeof(tmpdir), "%s/mutt-gpgme-XXXXXX", NONULL (Tempdir)); if (!mkdtemp (tmpdir)) { dprint (1, (debugfile, "Error creating temporary GPGME home\n")); @@ -860,7 +860,7 @@ int crypt_get_keys (HEADER *msg, char **keylist, int oppenc_mode) } } - if (!oppenc_mode && self_encrypt && *self_encrypt) + if (!oppenc_mode && self_encrypt) { keylist_size = mutt_strlen (*keylist); safe_realloc (keylist, keylist_size + mutt_strlen (self_encrypt) + 2); @@ -926,7 +926,7 @@ int mutt_should_hide_protected_subject (HEADER *h) if (option (OPTCRYPTPROTHDRSWRITE) && (h->security & ENCRYPT) && !(h->security & INLINE) && - ProtHdrSubject && *ProtHdrSubject) + ProtHdrSubject) return 1; return 0; diff --git a/curs_main.c b/curs_main.c index 32925f29..2054f42d 100644 --- a/curs_main.c +++ b/curs_main.c @@ -2360,7 +2360,7 @@ int mutt_index_menu (void) if (!mutt_get_field (_("Enter macro stroke: "), buf, sizeof(buf), MUTT_CLEAR) && buf[0]) { - snprintf(str, sizeof(str), "%s%s", MarkMacroPrefix, buf); + snprintf(str, sizeof(str), "%s%s", NONULL (MarkMacroPrefix), buf); snprintf(macro, sizeof(macro), "<search>~i \"%s\"\n", CURHDR->env->message_id); /* L10N: "message hotkey" is the key bindings menu description of a @@ -1546,7 +1546,7 @@ void mutt_decode_attachment (BODY *b, STATE *s) if (istext && s->flags & MUTT_CHARCONV) { char *charset = mutt_get_parameter ("charset", b->parameter); - if (!charset && AssumedCharset && *AssumedCharset) + if (!charset && AssumedCharset) charset = mutt_get_default_charset (); if (charset && Charset) cd = mutt_iconv_open (Charset, charset, MUTT_ICONV_HOOK_FROM); @@ -609,8 +609,7 @@ mutt_hcache_per_folder(const char *path, const char *folder, char* s; int ret, plen; #ifndef HAVE_ICONV - const char *chs = Charset && *Charset ? Charset : - mutt_get_default_charset (); + const char *chs = Charset ? Charset : mutt_get_default_charset (); #endif plen = mutt_strlen (path); @@ -334,7 +334,7 @@ int mutt_parse_idxfmt_hook (BUFFER *buf, BUFFER *s, union pointer_long_t udata, goto out; } - if (DefaultHook && *DefaultHook) + if (DefaultHook) mutt_check_simple (pattern, DefaultHook); /* check to make sure that a matching hook doesn't already exist */ diff --git a/imap/auth.c b/imap/auth.c index 38512be7..e32b5ab4 100644 --- a/imap/auth.c +++ b/imap/auth.c @@ -57,7 +57,7 @@ int imap_authenticate (IMAP_DATA* idata) char* delim; int r = -1; - if (ImapAuthenticators && *ImapAuthenticators) + if (ImapAuthenticators) { /* Try user-specified list of authentication methods */ methods = safe_strdup (ImapAuthenticators); diff --git a/imap/auth_oauth.c b/imap/auth_oauth.c index 8c7ab9d0..a301e166 100644 --- a/imap/auth_oauth.c +++ b/imap/auth_oauth.c @@ -42,7 +42,7 @@ imap_auth_res_t imap_auth_oauth (IMAP_DATA* idata, const char* method) return IMAP_AUTH_UNAVAIL; /* If they did not explicitly request or configure oauth then fail quietly */ - if (!(method || (ImapOauthRefreshCmd && *ImapOauthRefreshCmd))) + if (!(method || ImapOauthRefreshCmd)) return IMAP_AUTH_UNAVAIL; mutt_message _("Authenticating (OAUTHBEARER)..."); @@ -2719,7 +2719,7 @@ static int source_rc (const char *rcfile, BUFFER *err) mutt_buffer_init (&token); while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line, MUTT_CONT)) != NULL) { - conv=ConfigCharset && (*ConfigCharset) && Charset; + conv=ConfigCharset && Charset; if (conv) { currentline=safe_strdup(linebuf); diff --git a/mutt_socket.c b/mutt_socket.c index 9c22f35f..fbb0e5c4 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -265,7 +265,7 @@ CONNECTION* mutt_conn_find (const CONNECTION* start, const ACCOUNT* account) conn->next = Connections; Connections = conn; - if (Tunnel && *Tunnel) + if (Tunnel) mutt_tunnel_socket_setup (conn); else if (account->flags & MUTT_ACCT_SSL) { @@ -496,7 +496,7 @@ void _mutt_buffer_expand_path (BUFFER *src, int rx) mutt_buffer_strcpy (p, NONULL (Maildir)); else #endif - if (Maildir && *Maildir && Maildir[strlen (Maildir) - 1] == '/') + if (Maildir && Maildir[strlen (Maildir) - 1] == '/') mutt_buffer_strcpy (p, NONULL (Maildir)); else mutt_buffer_printf (p, "%s/", NONULL (Maildir)); @@ -183,7 +183,7 @@ static PARAMETER *parse_parameters (const char *s) s++; for (i=0; *s && i < sizeof (buffer) - 1; i++, s++) { - if (AssumedCharset && *AssumedCharset) + if (AssumedCharset) { /* As iso-2022-* has a character of '"' with non-ascii state, * ignore it. */ @@ -371,7 +371,7 @@ void mutt_parse_content_type (char *s, BODY *ct) if (ct->type == TYPETEXT) { if (!(pc = mutt_get_parameter ("charset", ct->parameter))) - mutt_set_parameter ("charset", (AssumedCharset && *AssumedCharset) ? + mutt_set_parameter ("charset", AssumedCharset ? (const char *) mutt_get_default_charset () : "us-ascii", &ct->parameter); } diff --git a/pgpinvoke.c b/pgpinvoke.c index c1ae7e39..d9a73d02 100644 --- a/pgpinvoke.c +++ b/pgpinvoke.c @@ -178,7 +178,7 @@ static pid_t pgp_invoke (FILE **pgpin, FILE **pgpout, FILE **pgperr, cctx.need_passphrase = need_passphrase; cctx.fname = fname; cctx.sig_fname = sig_fname; - if (PgpSignAs && *PgpSignAs) + if (PgpSignAs) cctx.signas = PgpSignAs; else cctx.signas = PgpDefaultKey; @@ -273,7 +273,7 @@ void pgp_invoke_import (const char *fname) mutt_buffer_quote_filename (fnamebuf, fname); cctx.fname = mutt_b2s (fnamebuf); - if (PgpSignAs && *PgpSignAs) + if (PgpSignAs) cctx.signas = PgpSignAs; else cctx.signas = PgpDefaultKey; @@ -328,7 +328,7 @@ static pop_auth_res_t pop_auth_oauth (POP_DATA *pop_data, const char *method) int ret, len; /* If they did not explicitly request or configure oauth then fail quietly */ - if (!(method || (PopOauthRefreshCmd && *PopOauthRefreshCmd))) + if (!(method || PopOauthRefreshCmd)) return POP_A_UNAVAIL; mutt_message _("Authenticating (OAUTHBEARER)..."); @@ -406,7 +406,7 @@ int pop_authenticate (POP_DATA* pop_data) if (mutt_account_getuser (acct) || !acct->user[0]) return -3; - if (PopAuthenticators && *PopAuthenticators) + if (PopAuthenticators) { /* Try user-specified list of authentication methods */ methods = safe_strdup (PopAuthenticators); @@ -433,7 +433,7 @@ int rfc1524_mailcap_lookup (BODY *a, char *type, rfc1524_entry *entry, int opt) * and overridden by the MAILCAPS environment variable, and, just to be nice, * we'll make it specifiable in .muttrc */ - if (!curr || !*curr) + if (!curr) { mutt_error _("No mailcap path specified"); return 0; @@ -593,7 +593,7 @@ void _rfc2047_encode_string (char **pd, int encode_specials, int col) return; charsets = SendCharset; - if (!charsets || !*charsets) + if (!charsets) charsets = "utf-8"; rfc2047_encode (*pd, strlen (*pd), col, @@ -810,7 +810,7 @@ static void convert_and_add_text (BUFFER *d, const char *text, size_t len) { char *t; - if (AssumedCharset && *AssumedCharset) + if (AssumedCharset) { t = safe_malloc (len + 1); strfcpy (t, text, len + 1); @@ -950,7 +950,7 @@ void rfc2047_decode_adrlist (ADDRESS *a) while (a) { if (a->personal && ((strstr (a->personal, "=?") != NULL) || - (AssumedCharset && *AssumedCharset))) + AssumedCharset)) rfc2047_decode (&a->personal); else if (a->group && a->mailbox && (strstr (a->mailbox, "=?") != NULL)) rfc2047_decode (&a->mailbox); @@ -116,7 +116,7 @@ void rfc2231_decode_parameters (PARAMETER **headp) if (option (OPTRFC2047PARAMS) && p->value && strstr (p->value, "=?")) rfc2047_decode (&p->value); - else if (AssumedCharset && *AssumedCharset) + else if (AssumedCharset) convert_nonmime_string (&p->value); *last = p; @@ -1455,7 +1455,7 @@ static int postpone_message (HEADER *msg, HEADER *cur, char *fcc, int flags) int is_signed; BODY *clear_content = NULL; - if (!(Postponed && *Postponed)) + if (!Postponed) { mutt_error _("Cannot postpone. $postponed is unset"); return -1; @@ -1472,10 +1472,10 @@ static int postpone_message (HEADER *msg, HEADER *cur, char *fcc, int flags) encrypt_as = PgpDefaultKey; else if ((WithCrypto & APPLICATION_SMIME) && (msg->security & APPLICATION_SMIME)) encrypt_as = SmimeDefaultKey; - if (!(encrypt_as && *encrypt_as)) + if (!encrypt_as) encrypt_as = PostponeEncryptAs; - if (encrypt_as && *encrypt_as) + if (encrypt_as) { is_signed = msg->security & SIGN; if (is_signed) @@ -915,8 +915,7 @@ CONTENT *mutt_get_content_info (const char *fname, BODY *b) if (b != NULL && b->type == TYPETEXT && (!b->noconv && !b->force_charset)) { char *chs = mutt_get_parameter ("charset", b->parameter); - char *fchs = b->use_disp ? ((AttachCharset && *AttachCharset) ? - AttachCharset : Charset) : Charset; + char *fchs = b->use_disp ? (AttachCharset ? AttachCharset : Charset) : Charset; if (Charset && (chs || SendCharset) && convert_file_from_to (fp, fchs, chs ? chs : SendCharset, &fromcode, &tocode, info) != (size_t)(-1)) @@ -1407,8 +1406,7 @@ BODY *mutt_make_file_attach (const char *path) att = mutt_new_body (); att->filename = safe_strdup (path); - if (MimeTypeQueryCmd && *MimeTypeQueryCmd && - option (OPTMIMETYPEQUERYFIRST)) + if (MimeTypeQueryCmd && option (OPTMIMETYPEQUERYFIRST)) run_mime_type_query (att); /* Attempt to determine the appropriate content-type based on the filename @@ -1418,7 +1416,7 @@ BODY *mutt_make_file_attach (const char *path) mutt_lookup_mime_type (att, path); if (!att->subtype && - MimeTypeQueryCmd && *MimeTypeQueryCmd && + MimeTypeQueryCmd && !option (OPTMIMETYPEQUERYFIRST)) run_mime_type_query (att); @@ -2856,7 +2854,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, if (hdr->security & SIGN) { fputc ('S', msg->fp); - if (PgpSignAs && *PgpSignAs) + if (PgpSignAs) fprintf (msg->fp, "<%s>", PgpSignAs); } if (hdr->security & INLINE) @@ -2872,7 +2870,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, if (hdr->security & ENCRYPT) { fputc ('E', msg->fp); - if (SmimeCryptAlg && *SmimeCryptAlg) + if (SmimeCryptAlg) fprintf (msg->fp, "C<%s>", SmimeCryptAlg); } if (hdr->security & OPPENCRYPT) @@ -2880,7 +2878,7 @@ int mutt_write_fcc (const char *path, HEADER *hdr, const char *msgid, int post, if (hdr->security & SIGN) { fputc ('S', msg->fp); - if (SmimeSignAs && *SmimeSignAs) + if (SmimeSignAs) fprintf (msg->fp, "<%s>", SmimeSignAs); } if (hdr->security & INLINE) @@ -859,7 +859,7 @@ void smime_getkeys (ENVELOPE *env) ADDRESS *t; int found = 0; - if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey && *SmimeDefaultKey) + if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey) { snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s", NONULL (SmimeKeys), SmimeDefaultKey); @@ -1545,8 +1545,8 @@ BODY *smime_sign_message (BODY *a ) char *intermediates; char *micalg; - signas = (SmimeSignAs && *SmimeSignAs) ? SmimeSignAs : SmimeDefaultKey; - if (!signas || !*signas) + signas = SmimeSignAs ? SmimeSignAs : SmimeDefaultKey; + if (!signas) { mutt_error _("Can't sign: No key specified. Use Sign As."); return NULL; @@ -508,7 +508,7 @@ static int smtp_auth (CONNECTION* conn) { int r = SMTP_AUTH_UNAVAIL; - if (SmtpAuthenticators && *SmtpAuthenticators) + if (SmtpAuthenticators) { char* methods = safe_strdup (SmtpAuthenticators); char* method; |