Use the newly introduced mutt_log_append function instead of directly
writing to debugfile. This is the last place where debugfile is used out
of mutt_log* functions, so its declaration can be removed from lib.h and
its definition made static in lib.c
---
 imap/imap.c | 3 +--
 lib.c       | 2 +-
 lib.h       | 2 --
 3 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/imap/imap.c b/imap/imap.c
index 6d108ed..181e9f7 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -235,8 +235,7 @@ int imap_read_literal (FILE* fp, IMAP_DATA* idata, long 
bytes, progress_t* pbar)
     if (pbar && !(pos % 1024))
       mutt_progress_update (pbar, pos, -1);
 #ifdef DEBUG
-    if (mutt_log_get_level () >= IMAP_LOG_LTRL)
-      fputc (c, debugfile);
+    mutt_log_append (IMAP_LOG_LTRL, "%c", c);
 #endif
   }
 
diff --git a/lib.c b/lib.c
index a90bc20..77a44f1 100644
--- a/lib.c
+++ b/lib.c
@@ -51,7 +51,7 @@
 #include "lib.h"
 
 #ifdef DEBUG
-FILE *debugfile = NULL;
+static FILE *debugfile = NULL;
 static int debuglevel = 0;
 #endif
 
diff --git a/lib.h b/lib.h
index f8f4d88..f35ed04 100644
--- a/lib.h
+++ b/lib.h
@@ -133,8 +133,6 @@ void mutt_exit (int);
 
 # ifdef DEBUG
 
-extern FILE *debugfile;
-
 int mutt_log_init (const char *reldate, const char *homedir);
 int mutt_log_set_level (int level);
 int mutt_log_get_level (void);
-- 
2.9.0

Reply via email to