int plen = mutt_str_strlen(path);
int rc = stat(path, &sb);
- int slash = (path[plen - 1] == '/');
+ bool slash = (path[plen - 1] == '/');
if (((rc == 0) && !S_ISDIR(sb.st_mode)) || ((rc == -1) && !slash))
{
*
* Count the number of patterns that can be done by the server (are full-text).
*/
-static int do_search(const struct PatternHead *search, int allpats)
+static int do_search(const struct PatternHead *search, bool allpats)
{
int rc = 0;
const struct Pattern *pat = NULL;
rc++;
break;
default:
- if (pat->child && do_search(pat->child, 1))
+ if (pat->child && do_search(pat->child, true))
rc++;
}
{
struct Pattern *firstpat = SLIST_FIRST(pat);
- if (do_search(pat, 0) == 0)
+ if (do_search(pat, false) == 0)
return 0;
if (firstpat->not)
{
int clauses;
- clauses = do_search(firstpat->child, 1);
+ clauses = do_search(firstpat->child, true);
if (clauses > 0)
{
mutt_buffer_addch(buf, '(');
while (clauses)
{
- if (do_search(firstpat->child, 0))
+ if (do_search(firstpat->child, false))
{
if ((firstpat->op == MUTT_PAT_OR) && (clauses > 1))
mutt_buffer_addstr(buf, "OR ");
for (int i = 0; i < m->msg_count; i++)
m->emails[i]->matched = false;
- if (do_search(pat, 1) == 0)
+ if (do_search(pat, true) == 0)
return 0;
mutt_buffer_init(&buf);
*/
void mutt_buffer_expand_path(struct Buffer *buf)
{
- mutt_buffer_expand_path_regex(buf, 0);
+ mutt_buffer_expand_path_regex(buf, false);
}
/**
*
* Return true if the OpenPGP engine's version is at least VERSION.
*/
-static int have_gpg_version(const char *version)
+static bool have_gpg_version(const char *version)
{
static char *engine_version;
if (!key)
return 1;
- int severe = 0;
+ bool severe = false;
if ((sum & GPGME_SIGSUM_KEY_REVOKED))
{
state_puts(_("Warning: One of the keys has been revoked\n"), s);
- severe = 1;
+ severe = true;
}
if ((sum & GPGME_SIGSUM_KEY_EXPIRED))
if ((sum & GPGME_SIGSUM_CRL_MISSING))
{
state_puts(_("The CRL is not available\n"), s);
- severe = 1;
+ severe = true;
}
if ((sum & GPGME_SIGSUM_CRL_TOO_OLD))
{
state_puts(_("Available CRL is too old\n"), s);
- severe = 1;
+ severe = true;
}
if ((sum & GPGME_SIGSUM_BAD_POLICY))
verify_result = gpgme_op_verify_result(ctx);
if (verify_result && verify_result->signatures)
{
- int anybad = 0;
+ bool anybad = false;
int res;
for (int idx = 0; (res = show_one_sig_status(ctx, idx, s)) != -1; idx++)
{
if (res == 1)
- anybad = 1;
+ anybad = true;
else if (res == 2)
anywarn = 2;
}
/* Before gpgme 1.9.0 and gpg 2.1.14 there was no side-effect free
* way to view key data in GPGME, so we import the key into a
* temporary keyring if we detect an older system. */
- int legacy_api;
+ bool legacy_api;
char tmpdir[PATH_MAX];
gpgme_ctx_t tmpctx;
gpgme_error_t err;
const char *shortid = NULL;
size_t len;
char date[256];
- int more;
+ bool more;
int rc = -1;
time_t tt;
#if GPGME_VERSION_NUMBER >= 0x010900 /* gpgme >= 1.9.0 */
legacy_api = !have_gpg_version("2.1.14");
#else /* gpgme < 1.9.0 */
- legacy_api = 1;
+ legacy_api = true;
#endif
tmpctx = create_gpgme_context(false);
break;
uid = key->uids;
subkey = key->subkeys;
- more = 0;
+ more = false;
while (subkey)
{
shortid = subkey->keyid;
subkey->length, shortid, date);
}
subkey = subkey->next;
- more = 1;
+ more = true;
}
gpgme_key_unref(key);
}
FILE *fp_pgp_in = NULL, *fp_tmp = NULL;
struct Body *t = NULL;
int err = 0;
- int empty = 0;
+ bool empty = false;
pid_t pid;
mutt_mktemp(tempfile, sizeof(tempfile));
mutt_file_fclose(&fp_pgp_in);
if (mutt_wait_filter(pid) && C_PgpCheckExit)
- empty = 1;
+ empty = true;
unlink(pgpinfile);
struct SmimeKey *trusted_match = NULL;
struct SmimeKey *valid_match = NULL;
struct SmimeKey *return_key = NULL;
- int multi_trusted_matches = 0;
if (!mailbox)
return NULL;
+ bool multi_trusted_matches = false;
results = smime_get_candidates(mailbox, public);
for (result = results; result; result = result->next)
{
if (trusted_match && (mutt_str_strcasecmp(match->hash, trusted_match->hash) != 0))
{
- multi_trusted_matches = 1;
+ multi_trusted_matches = true;
}
trusted_match = match;
}
const char *pc = s;
bool have_min = false;
- int until_now = false;
+ bool until_now = false;
if (isdigit((unsigned char) *pc))
{
/* minimum date specified */
int rfc1524_expand_filename(const char *nametemplate, const char *oldfile,
char *newfile, size_t nflen)
{
- int i, j, k, ps;
+ int i, j, k;
char *s = NULL;
bool lmatch = false, rmatch = false;
char left[PATH_MAX];
* (if there is one). */
lmatch = true;
- ps = 0;
+ bool ps = false;
for (i = 0; nametemplate[i]; i++)
{
if ((nametemplate[i] == '%') && (nametemplate[i + 1] == 's'))
{
- ps = 1;
+ ps = true;
break;
}