From 89f2182f03284a8b583257968df2cd98f5cdcb15 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Fri, 27 Aug 2010 00:25:07 +0300 Subject: [PATCH] * some minor cleanups --- src/mu-config.c | 2 +- src/mu-maildir.c | 10 +++++----- src/mu-maildir.h | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mu-config.c b/src/mu-config.c index 79547924..38f70741 100644 --- a/src/mu-config.c +++ b/src/mu-config.c @@ -83,7 +83,7 @@ config_options_group_mu (MuConfigOptions *opts) static void -set_group_index_defaults (MuConfigOptions *opts) +set_group_index_defaults (MuConfigOptions *opts) { gchar *old; diff --git a/src/mu-maildir.c b/src/mu-maildir.c index 005d18c5..93010603 100644 --- a/src/mu-maildir.c +++ b/src/mu-maildir.c @@ -1,5 +1,5 @@ /* -** Copyright (C) 2010 Dirk-Jan C. Binnema +** Copyright (C) 2010-2010 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -17,7 +17,9 @@ ** */ +#ifdef HAVE_CONFIG_H #include "config.h" +#endif /*HAVE_CONFIG_H*/ #include #include @@ -32,13 +34,12 @@ #include "mu-util.h" #include "mu-maildir.h" - #define MU_MAILDIR_WALK_MAX_FILE_SIZE (32*1000*1000) #define MU_MAILDIR_NOINDEX_FILE ".noindex" #define MU_MAILDIR_CACHE_FILE ".mu.cache" /* note: this function is *not* re-entrant, it returns a static buffer */ -const char* +static const char* fullpath_s (const char* path, const char* name) { static char buf[4096]; @@ -242,7 +243,6 @@ process_file (const char* fullpath, const gchar* mdir, * use the ctime, so any status change will be visible (perms, * filename etc.) */ - g_debug ("[%s]", mdir); result = (msg_cb)(fullpath, mdir, statbuf.st_ctime, data); if (result == MU_STOP) g_debug ("callback said 'MU_STOP' for %s", fullpath); @@ -313,7 +313,7 @@ readdir_with_stat_fallback (DIR* dir, const char* path) entry = readdir (dir); if (!entry) { - if (errno) + if (errno != 0) g_warning ("readdir failed in %s: %s", path, strerror (errno)); return NULL; diff --git a/src/mu-maildir.h b/src/mu-maildir.h index 90083538..c6aaebbe 100644 --- a/src/mu-maildir.h +++ b/src/mu-maildir.h @@ -1,5 +1,5 @@ /* -** Copyright (C) 2010 Dirk-Jan C. Binnema +** Copyright (C) 2008-2010 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -26,7 +26,7 @@ #include "mu-result.h" /* for MuResult */ -/** +/** * create a new maildir. Note, if the function fails 'halfway', it * will *not* try to remove the parts the were created. it *will* * create any parent dirs that are not yet existant. @@ -42,7 +42,7 @@ gboolean mu_maildir_mkmdir (const char* path, mode_t mode, gboolean noindex); -/** +/** * create a symbolic link to a mail message * * @param src the full path to the source message @@ -54,7 +54,7 @@ gboolean mu_maildir_mkmdir (const char* path, mode_t mode, gboolean noindex); */ gboolean mu_maildir_link (const char* src, const char *targetpath); -/** +/** * MuMaildirWalkMsgCallback -- callback function for * mu_path_walk_maildir; see the documentation there. It will be * called for each message found, with fullpath containing the full @@ -66,7 +66,7 @@ gboolean mu_maildir_link (const char* src, const char *targetpath); typedef MuResult (*MuMaildirWalkMsgCallback) (const char* fullpath, const char* mdir, time_t timestamp, void *user_data); -/** +/** * MuPathWalkDirCallback -- callback function for mu_path_walk_maildir; see the * documentation there. It will be called each time a dir is entered or left, * with 'enter' being TRUE upon entering, FALSE otherwise @@ -74,7 +74,7 @@ typedef MuResult (*MuMaildirWalkMsgCallback) typedef MuResult (*MuMaildirWalkDirCallback) (const char* fullpath, gboolean enter, void *user_data); -/** +/** * start a recursive walk of a maildir; for each file found, we call * callback with the path (with the Maildir path of scanner_new as * root), the filename, the timestamp (mtime) of the file,and the @@ -100,7 +100,7 @@ typedef MuResult (*MuMaildirWalkDirCallback) */ MuResult mu_maildir_walk (const char *path, MuMaildirWalkMsgCallback cb_msg, MuMaildirWalkDirCallback cb_dir, void *data); -/** +/** * recursively delete all the symbolic links in a directory tree * * @param dir top dir