* fix some small issues

This commit is contained in:
Dirk-Jan C. Binnema 2011-05-09 09:20:27 +03:00
parent 53b87a79eb
commit 7aea532838
3 changed files with 18 additions and 19 deletions

View File

@ -228,7 +228,7 @@ mu_msg_field_id_from_name (const char* str, gboolean err)
g_return_val_if_fail (str, MU_MSG_FIELD_ID_NONE);
for (i = 0; i != G_N_ELEMENTS(FIELD_DATA); ++i)
if (strcmp(str, FIELD_DATA[i]._name) == 0)
if (g_strcmp0(str, FIELD_DATA[i]._name) == 0)
return FIELD_DATA[i]._id;
if (err)

View File

@ -33,11 +33,10 @@
#include "mu-maildir.h"
#include "mu-msg-priv.h"
static gboolean init_file_metadata (MuMsgFile *self, const char* path, const char *mdir,
GError **err);
static gboolean init_file_metadata (MuMsgFile *self, const char* path,
const char *mdir, GError **err);
static gboolean init_mime_msg (MuMsgFile *msg, GError **err);
#define CACHE(MFID) (self->_str_cache[(MFID)])
#define SET_CACHE(MFID,V)(self->_str_cache[(MFID)]=(V))
@ -50,6 +49,9 @@ mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
g_return_val_if_fail (filepath, NULL);
self = g_slice_new0 (MuMsgFile);
for (i = 0; i != MU_MSG_FIELD_ID_NUM; ++i)
SET_CACHE(i,NULL);
if (!init_file_metadata (self, filepath, mdir, err)) {
mu_msg_file_destroy (self);
return NULL;
@ -60,9 +62,6 @@ mu_msg_file_new (const char* filepath, const char *mdir, GError **err)
return NULL;
}
for (i = 0; i != MU_MSG_FIELD_ID_NUM; ++i)
SET_CACHE(i,NULL);
return self;
}