{
char *s;
- if (!ConfigCharset || !*ConfigCharset || !Charset)
+ if (!ConfigCharset || !Charset)
return;
s = safe_strdup (buf);
if (!s)
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 */
const char *c = AssumedCharset;
const char *c1;
- if (c && *c)
+ if (c)
{
c1 = strchr (c, ':');
strfcpy (fcharset, c, c1 ? (c1 - c + 1) : sizeof (fcharset));
return (0);
}
- if (DisplayFilter && *DisplayFilter)
+ if (DisplayFilter)
{
fpfilterout = fpout;
fpout = NULL;
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;
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: "));
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);
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"));
}
}
- 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);
if (option (OPTCRYPTPROTHDRSWRITE) &&
(h->security & ENCRYPT) &&
!(h->security & INLINE) &&
- ProtHdrSubject && *ProtHdrSubject)
+ ProtHdrSubject)
return 1;
return 0;
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
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);
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);
goto out;
}
- if (DefaultHook && *DefaultHook)
+ if (DefaultHook)
mutt_check_simple (pattern, DefaultHook);
/* check to make sure that a matching hook doesn't already exist */
char* delim;
int r = -1;
- if (ImapAuthenticators && *ImapAuthenticators)
+ if (ImapAuthenticators)
{
/* Try user-specified list of authentication methods */
methods = safe_strdup (ImapAuthenticators);
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)...");
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);
conn->next = Connections;
Connections = conn;
- if (Tunnel && *Tunnel)
+ if (Tunnel)
mutt_tunnel_socket_setup (conn);
else if (account->flags & MUTT_ACCT_SSL)
{
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));
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. */
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);
}
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;
mutt_buffer_quote_filename (fnamebuf, fname);
cctx.fname = mutt_b2s (fnamebuf);
- if (PgpSignAs && *PgpSignAs)
+ if (PgpSignAs)
cctx.signas = PgpSignAs;
else
cctx.signas = PgpDefaultKey;
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)...");
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);
* 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;
return;
charsets = SendCharset;
- if (!charsets || !*charsets)
+ if (!charsets)
charsets = "utf-8";
rfc2047_encode (*pd, strlen (*pd), col,
{
char *t;
- if (AssumedCharset && *AssumedCharset)
+ if (AssumedCharset)
{
t = safe_malloc (len + 1);
strfcpy (t, text, len + 1);
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);
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;
int is_signed;
BODY *clear_content = NULL;
- if (!(Postponed && *Postponed))
+ if (!Postponed)
{
mutt_error _("Cannot postpone. $postponed is unset");
return -1;
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)
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))
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
mutt_lookup_mime_type (att, path);
if (!att->subtype &&
- MimeTypeQueryCmd && *MimeTypeQueryCmd &&
+ MimeTypeQueryCmd &&
!option (OPTMIMETYPEQUERYFIRST))
run_mime_type_query (att);
if (hdr->security & SIGN)
{
fputc ('S', msg->fp);
- if (PgpSignAs && *PgpSignAs)
+ if (PgpSignAs)
fprintf (msg->fp, "<%s>", PgpSignAs);
}
if (hdr->security & INLINE)
if (hdr->security & ENCRYPT)
{
fputc ('E', msg->fp);
- if (SmimeCryptAlg && *SmimeCryptAlg)
+ if (SmimeCryptAlg)
fprintf (msg->fp, "C<%s>", SmimeCryptAlg);
}
if (hdr->security & OPPENCRYPT)
if (hdr->security & SIGN)
{
fputc ('S', msg->fp);
- if (SmimeSignAs && *SmimeSignAs)
+ if (SmimeSignAs)
fprintf (msg->fp, "<%s>", SmimeSignAs);
}
if (hdr->security & INLINE)
ADDRESS *t;
int found = 0;
- if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey && *SmimeDefaultKey)
+ if (option (OPTSDEFAULTDECRYPTKEY) && SmimeDefaultKey)
{
snprintf (SmimeKeyToUse, sizeof (SmimeKeyToUse), "%s/%s",
NONULL (SmimeKeys), SmimeDefaultKey);
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;
{
int r = SMTP_AUTH_UNAVAIL;
- if (SmtpAuthenticators && *SmtpAuthenticators)
+ if (SmtpAuthenticators)
{
char* methods = safe_strdup (SmtpAuthenticators);
char* method;