X509 *cert = NULL;
X509_STORE *store = NULL;
int rc = 1;
-#ifdef DEBUG
char buf[STRING];
-#endif
mutt_debug(2, "loading trusted certificates\n");
store = SSL_CTX_get_cert_store(ctx);
data->isopen = 0;
break;
}
-#ifdef DEBUG
+
const char *errmsg = NULL;
unsigned long sslerr;
}
mutt_debug(1, "SSL error: %s\n", errmsg);
-#endif
}
/**
- * ssl_dprint_err_stack - Dump the SSL error stack (DEBUG only)
+ * ssl_dprint_err_stack - Dump the SSL error stack
*/
static void ssl_dprint_err_stack(void)
{
-#ifdef DEBUG
BIO *bio = NULL;
char *buf = NULL;
long buflen;
FREE(&output);
}
BIO_free(bio);
-#endif
}
/**
return 1;
}
-#ifdef DEBUG
/* log verification error */
- {
- int err = X509_STORE_CTX_get_error(ctx);
- snprintf(buf, sizeof(buf), "%s (%d)", X509_verify_cert_error_string(err), err);
- mutt_debug(2, "X509_verify_cert: %s\n", buf);
- }
-#endif
+ int err = X509_STORE_CTX_get_error(ctx);
+ snprintf(buf, sizeof(buf), "%s (%d)", X509_verify_cert_error_string(err), err);
+ mutt_debug(2, "X509_verify_cert: %s\n", buf);
/* prompt user */
return interactive_check_cert(cert, pos, len, ssl, 1);
if (copy_delete_attach(body, fpin, fpout, date))
return -1;
-#ifdef DEBUG
+ LOFF_T fail = ((ftello(fpout) - new_offset) - new_length);
+ if (fail)
{
- LOFF_T fail = ((ftello(fpout) - new_offset) - new_length);
-
- if (fail)
- {
- mutt_error("The length calculation was wrong by %ld bytes", fail);
- new_length += fail;
- mutt_sleep(1);
- }
+ mutt_error("The length calculation was wrong by %ld bytes", fail);
+ new_length += fail;
+ mutt_sleep(1);
}
-#endif
/* Update original message if we are sync'ing a mailfolder */
if (flags & MUTT_CM_UPDATE)
WHERE short NntpContext;
#endif
-#ifdef DEBUG
WHERE short DebugLevel;
WHERE char *DebugFile;
-#endif
WHERE short History;
WHERE short MenuContext;
return db;
else
{
-#ifdef DEBUG
int ecode = kcdbecode(db);
mutt_debug(2, "kcdbopen failed for %s: %s (ecode %d)\n", kcdbpath, kcdbemsg(db), ecode);
-#endif
kcdbdel(db);
return NULL;
}
KCDB *db = *ctx;
if (!kcdbclose(db))
{
-#ifdef DEBUG
int ecode = kcdbecode(db);
mutt_debug(2, "kcdbclose failed: %s (ecode %d)\n", kcdbemsg(db), ecode);
-#endif
}
kcdbdel(db);
}
return db;
else
{
-#ifdef DEBUG
int ecode = tcbdbecode(db);
mutt_debug(2, "tcbdbopen failed for %s: %s (ecode %d)\n", path,
tcbdberrmsg(ecode), ecode);
-#endif
tcbdbdel(db);
return NULL;
}
TCBDB *db = *ctx;
if (!tcbdbclose(db))
{
-#ifdef DEBUG
int ecode = tcbdbecode(db);
mutt_debug(2, "tcbdbclose failed: %s (ecode %d)\n", tcbdberrmsg(ecode), ecode);
-#endif
}
tcbdbdel(db);
}
gss_buffer_t sec_token;
gss_name_t target_name;
gss_ctx_id_t context;
-#ifdef DEBUG
gss_OID mech_name;
char server_conf_flags;
-#endif
gss_qop_t quality;
int cflags;
OM_uint32 maj_stat, min_stat;
mutt_debug(2, "Couldn't get service name for [%s]\n", buf1);
return IMAP_AUTH_UNAVAIL;
}
-#ifdef DEBUG
else if (debuglevel >= 2)
{
gss_display_name(&min_stat, target_name, &request_buf, &mech_name);
mutt_debug(2, "Using service name [%s]\n", (char *) request_buf.value);
gss_release_buffer(&min_stat, &request_buf);
}
-#endif
/* Acquire initial credentials - without a TGT GSSAPI is UNAVAIL */
sec_token = GSS_C_NO_BUFFER;
context = GSS_C_NO_CONTEXT;
mutt_debug(2, "Credential exchange complete\n");
/* first octet is security levels supported. We want NONE */
-#ifdef DEBUG
server_conf_flags = ((char *) send_token.value)[0];
-#endif
if (!(((char *) send_token.value)[0] & GSS_AUTH_P_NONE))
{
mutt_debug(2, "Server requires integrity or privacy\n");
imap_quote_string(q_user, sizeof(q_user), idata->conn->account.user);
imap_quote_string(q_pass, sizeof(q_pass), idata->conn->account.pass);
-#ifdef DEBUG
/* don't print the password unless we're at the ungodly debugging level
* of 5 or higher */
if (debuglevel < IMAP_LOG_PASS)
mutt_debug(2, "Sending LOGIN command for %s...\n", idata->conn->account.user);
-#endif
snprintf(buf, sizeof(buf), "LOGIN %s %s", q_user, q_pass);
rc = imap_exec(idata, buf, IMAP_CMD_FAIL_OK | IMAP_CMD_PASS);
if (pbar && !(pos % 1024))
mutt_progress_update(pbar, pos, -1);
-#ifdef DEBUG
if (debuglevel >= IMAP_LOG_LTRL)
fputc(c, debugfile);
-#endif
}
return 0;
ctx->readonly = true;
}
-#ifdef DEBUG
/* dump the mailbox flags we've found */
if (debuglevel > 2)
{
FREE(&flag_buffer.data);
}
}
-#endif
if (!(mutt_bit_isset(idata->ctx->rights, MUTT_ACL_DELETE) ||
mutt_bit_isset(idata->ctx->rights, MUTT_ACL_SEEN) ||
mutt_group_context_add_adrlist(gc, tmp->addr);
mutt_alias_add_reverse(tmp);
-#ifdef DEBUG
if (debuglevel >= 2)
{
/* A group is terminated with an empty address, so check a->mailbox */
mutt_debug(3, " Group %s\n", a->mailbox);
}
}
-#endif
mutt_group_context_destroy(&gc);
return 0;
case DT_PATH:
FREE((char **) p->data);
char *init = NULL;
-#ifdef DEBUG
if (mutt_str_strcmp(p->option, "debug_file") == 0 && debugfile_cmdline)
init = debugfile_cmdline;
else
-#endif
init = (char *) p->init;
if (init)
{
case DT_NUMBER:
case DT_SORT:
case DT_MAGIC:
-#ifdef DEBUG
if (mutt_str_strcmp(p->option, "debug_level") == 0 && debuglevel_cmdline)
*((short *) p->data) = debuglevel_cmdline;
else
-#endif
*((short *) p->data) = p->init;
break;
case DT_REGEX:
return envlist;
}
-#ifdef DEBUG
/**
* start_debug - prepare the debugging file
*
if (enable_debug || (file_changed && debuglevel > 0))
start_debug();
}
-#endif
/* mutt_envlist_set - Helper function for parse_setenv()
* @param name Name of the environment variable
}
else if (DTYPE(MuttVars[idx].type) == DT_PATH)
{
-#ifdef DEBUG
if (mutt_str_strcmp(MuttVars[idx].option, "debug_file") == 0 && debugfile_cmdline)
{
- mutt_message(_("set debug_file ignored, it have been overridden "
- "with cmdline"));
+ mutt_message(_("set debug_file ignored, it has been overridden by the cmdline"));
break;
}
-#endif
/* MuttVars[idx].data is already 'char**' (or some 'void**') or...
* so cast to 'void*' is okay */
FREE((void *) MuttVars[idx].data);
mutt_str_strfcpy(scratch, tmp->data, sizeof(scratch));
mutt_expand_path(scratch, sizeof(scratch));
*((char **) MuttVars[idx].data) = mutt_str_strdup(scratch);
-#ifdef DEBUG
if (mutt_str_strcmp(MuttVars[idx].option, "debug_file") == 0)
restart_debug();
-#endif
}
else if (DTYPE(MuttVars[idx].type) == DT_STRING)
{
r = -1;
break;
}
-#ifdef DEBUG
else if (mutt_str_strcmp(MuttVars[idx].option, "debug_level") == 0 && debuglevel_cmdline)
{
- mutt_message(
- _("set debug_level ignored, it have been overridden with cmdline"));
+ mutt_message(_("set debug_level ignored, it has been overridden by the cmdline"));
break;
}
-#endif
else
*ptr = val;
*ptr = 0;
mutt_init_history();
}
-#ifdef DEBUG
else if (mutt_str_strcmp(MuttVars[idx].option, "debug_level") == 0)
{
if (*ptr < 0)
*ptr = 0;
restart_debug();
}
-#endif
else if (mutt_str_strcmp(MuttVars[idx].option, "pager_index_lines") == 0)
{
if (*ptr < 0)
Shell = mutt_str_strdup((p = getenv("SHELL")) ? p : "/bin/sh");
}
-#ifdef DEBUG
/* Start up debugging mode if requested from cmdline */
if (debuglevel_cmdline > 0)
{
}
start_debug();
}
-#endif
/* And about the host... */
** rest of the string are expanded in the \fIC\fP locale (that is in US
** English).
*/
-#ifdef DEBUG
{ "debug_level", DT_NUMBER, R_NONE, UL &DebugLevel, 0 },
/*
** .pp
** Old debug files are renamed with the prefix 1, 2, 3 and 4.
** See ``debug_level'' for more detail.
*/
-#endif
{ "default_hook", DT_STRING, R_NONE, UL &DefaultHook, UL "~f %s !~P | (~P ~C %s)" },
/*
** .pp
" -D print the value of all variables to stdout\n"
" -D -S like -D, but hide the value of sensitive variables\n"
" -B run in batch mode (do not start the ncurses UI)"));
-#ifdef DEBUG
puts(_(" -d <level> log debugging output to ~/.neomuttdebug0"));
-#endif
puts(_(
" -E edit the draft (-H) or include (-i) file\n"
" -e <command> specify a command to be executed after initialization\n"
break;
case 'd':
-#ifdef DEBUG
if (mutt_str_atoi(optarg, &debuglevel_cmdline) < 0 || debuglevel_cmdline <= 0)
{
fprintf(stderr, _("Error: value '%s' is invalid for -d.\n"), optarg);
return 1;
}
printf(_("Debugging at level %d.\n"), debuglevel_cmdline);
-#else
- printf("%s",
- _("DEBUG was not defined during compilation. -d Ignored.\n"));
-#endif
break;
case 'E':
break;
case 'l':
-#ifdef DEBUG
debugfile_cmdline = optarg;
printf(_("Debugging at file %s.\n"), debugfile_cmdline);
-#else
- printf(_("DEBUG was not defined during compilation. -l Ignored.\n"));
-#endif
break;
case 'm':
char *mutt_compile_help(char *buf, size_t buflen, int menu, const struct Mapping *items);
-#ifdef DEBUG
extern char debugfilename[_POSIX_PATH_MAX];
extern FILE *debugfile;
extern int debuglevel;
extern char *debugfile_cmdline;
extern int debuglevel_cmdline;
-#endif
#endif /* _MUTT_H */
#ifndef _MUTT_DEBUG_H
#define _MUTT_DEBUG_H
-#ifdef DEBUG
int mutt_debug_real(const char *function, const char *file, int line, int level, ...);
#define mutt_debug(LEVEL, ...) mutt_debug_real(__func__, __FILE__, __LINE__, LEVEL, __VA_ARGS__)
-#else
-#define mutt_debug(...) do { } while (0)
-#endif
#endif /* _MUTT_DEBUG_H */
static int update_header_tags(struct Header *h, notmuch_message_t *msg)
{
-#ifdef DEBUG
struct NmHdrData *data = h->data;
-#endif
notmuch_tags_t *tags = NULL;
char *new_tags = NULL;
char *old_tags = NULL;
{
struct Buffer *srcbuf = NULL, *word = NULL, *command = NULL;
char srccopy[LONG_STRING];
-#ifdef DEBUG
int i = 0;
-#endif
mutt_debug(3, "fmtpipe = %s\n", src);
}
}
-#ifdef DEBUG
char debugfilename[_POSIX_PATH_MAX];
FILE *debugfile = NULL;
int debuglevel;
va_end(ap);
return ret;
}
-#endif
/**
* mutt_inbox_cmp - do two folders share the same path and one is an inbox
mutt_message(_("Passphrase(s) forgotten."));
}
-#if (!defined(DEBUG))
-
+#ifndef DEBUG
#include <sys/resource.h>
static void disable_coredumps(void)
{
done = true;
}
}
-
#endif
/**
{
int rc = 0;
-#if !defined(DEBUG)
+#ifndef DEBUG
disable_coredumps();
#endif
/* username accepted, sending password */
if (mutt_str_strncmp("381", buf, 3) == 0)
{
-#ifdef DEBUG
if (debuglevel < MUTT_SOCK_LOG_FULL)
mutt_debug(MUTT_SOCK_LOG_CMD, "%d> AUTHINFO PASS *\n", conn->fd);
-#endif
snprintf(buf, sizeof(buf), "AUTHINFO PASS %s\r\n", conn->account.pass);
if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln(buf, sizeof(buf), conn) < 0)
/* send out client response */
if (client_len)
{
-#ifdef DEBUG
if (debuglevel >= MUTT_SOCK_LOG_FULL)
{
char tmp[LONG_STRING];
*p = '\0';
mutt_debug(1, "SASL> %s\n", tmp);
}
-#endif
if (*buf)
mutt_str_strcat(buf, sizeof(buf), " ");
}
mutt_str_strcat(buf, sizeof(buf), "\r\n");
-#ifdef DEBUG
if (debuglevel < MUTT_SOCK_LOG_FULL)
{
if (strchr(buf, ' '))
else
mutt_debug(MUTT_SOCK_LOG_CMD, "%d> sasl_data\n", conn->fd);
}
-#endif
client_len = 0;
if (mutt_socket_write_d(conn, buf, -1, MUTT_SOCK_LOG_FULL) < 0 ||
mutt_socket_readln_d(inbuf, sizeof(inbuf), conn, MUTT_SOCK_LOG_FULL) < 0)
if ((mutt_str_strncmp(inbuf, "283 ", 4) != 0) &&
(mutt_str_strncmp(inbuf, "383 ", 4) != 0))
{
-#ifdef DEBUG
if (debuglevel < MUTT_SOCK_LOG_FULL)
mutt_debug(MUTT_SOCK_LOG_CMD, "%d< %s\n", conn->fd, inbuf);
-#endif
break;
}
-#ifdef DEBUG
if (debuglevel < MUTT_SOCK_LOG_FULL)
{
inbuf[3] = '\0';
mutt_debug(MUTT_SOCK_LOG_CMD, "%d< %s sasl_data\n", conn->fd, inbuf);
}
-#endif
if (strcmp("=", inbuf + 4) == 0)
len = 0;
mutt_debug(1, "error base64-decoding server response.\n");
break;
}
-#ifdef DEBUG
else if (debuglevel >= MUTT_SOCK_LOG_FULL)
{
char tmp[LONG_STRING];
*p = '\0';
mutt_debug(1, "SASL< %s\n", tmp);
}
-#endif
while (true)
{
{
snprintf(buf, sizeof(buf), "PASS %s\r\n", pop_data->conn->account.pass);
ret = pop_query_d(pop_data, buf, sizeof(buf),
-#ifdef DEBUG
/* don't print the password unless we're at the ungodly debugging level */
debuglevel < MUTT_SOCK_LOG_FULL ? "PASS *\r\n" :
-#endif
NULL);
}
if (pop_data->status != POP_CONNECTED)
return -1;
-#ifdef DEBUG
/* print msg instead of real command */
if (msg)
{
dbg = MUTT_SOCK_LOG_FULL;
mutt_debug(MUTT_SOCK_LOG_CMD, "> %s", msg);
}
-#endif
mutt_socket_write_d(pop_data->conn, buf, -1, dbg);
*/
void rfc3676_space_stuff(struct Header *hdr)
{
-#ifdef DEBUG
int lc = 0;
size_t len = 0;
unsigned char c = '\0';
-#endif
FILE *in = NULL, *out = NULL;
char buf[LONG_STRING];
char tmpfile[_POSIX_PATH_MAX];
if ((mutt_str_strncmp("From ", buf, 5) == 0) || buf[0] == ' ')
{
fputc(' ', out);
-#ifdef DEBUG
lc++;
len = mutt_str_strlen(buf);
if (len > 0)
mutt_debug(4, "f=f: line %d needs space-stuffing: '%s'\n", lc, buf);
if (len > 0)
buf[len - 1] = c;
-#endif
}
fputs(buf, out);
}
{ "compose_to_sender", 1 },
{ "compress", 1 },
{ "cond_date", 1 },
+ { "debug", 1 },
{ "encrypt_to_self", 1 },
{ "forgotten_attachments", 1 },
{ "forwref", 1 },
#else
{ "curs_set", 0 },
#endif
-#ifdef DEBUG
- { "debug", 1 },
-#else
- { "debug", 0 },
-#endif
#ifdef USE_FCNTL
{ "fcntl", 1 },
#else