summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorDavid Champion <dgc@extrahop.com>2020-11-19 19:04:52 -0800
committerKevin McCarthy <kevin@8t8.us>2020-11-22 09:30:37 -0800
commit03803e6789fb9a27570b75f3e6510e1881f63673 (patch)
tree8c9173a74199ee95ed2784bc8fd4b54727097093 /main.c
parentbb0cd9442a1aad91a9597e64b75392debcee0a95 (diff)
Allow debugging without debug file rotation.
start_debug() takes a boolean indicating whether to rotate debug files. The -d option allows a negative number. If negative, debug files are not rotated. The debug level is the absolute value. This is useful for continuously watching (e.g. tail -f) the .muttdebug0 file.
Diffstat (limited to 'main.c')
-rw-r--r--main.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/main.c b/main.c
index 60773fd7..89d970f9 100644
--- a/main.c
+++ b/main.c
@@ -149,7 +149,8 @@ options:\n\
-c <address>\tspecify a carbon-copy (CC) address\n\
-D\t\tprint the value of all variables to stdout");
#if DEBUG
- puts _(" -d <level>\tlog debugging output to ~/.muttdebug0");
+ puts _(" -d <level>\tlog debugging output to ~/.muttdebug0\n\
+\t\t0 => no debugging; <0 => do not rotate .muttdebug files");
#endif
puts _(
" -E\t\tedit the draft (-H) or include (-i) file\n\
@@ -742,11 +743,7 @@ int main (int argc, char **argv, char **environ)
case 'd':
#ifdef DEBUG
- if (mutt_atoi (optarg, &debuglevel) < 0 || debuglevel <= 0)
- {
- fprintf (stderr, _("Error: value '%s' is invalid for -d.\n"), optarg);
- return 1;
- }
+ mutt_atoi (optarg, &debuglevel);
printf (_("Debugging at level %d.\n"), debuglevel);
#else
printf ("%s", _("DEBUG was not defined during compilation. Ignored.\n"));