X-Git-Url: http://git.madism.org/?a=blobdiff_plain;ds=inline;f=main.c;h=8f1c8b4c487f31d3a187bc5f0232b826d9e79277;hb=711f787502b6a1a1c150b948a5ed9156c8ef9ba1;hp=beade2d38f82b041b79d0baea63b6bee46ef2242;hpb=108f3c7ab59844591f7540347914ea57be5245e2;p=apps%2Fmadmutt.git diff --git a/main.c b/main.c index beade2d..8f1c8b4 100644 --- a/main.c +++ b/main.c @@ -15,7 +15,7 @@ #define MAIN_C 1 -#if HAVE_CONFIG_H +#ifdef HAVE_CONFIG_H # include "config.h" #endif @@ -41,6 +41,7 @@ #include #include "mutt.h" +#include "alias.h" #include "mx.h" #include "buffy.h" #include "sort.h" @@ -69,11 +70,11 @@ extern int optind; #endif #ifdef USE_HCACHE -#if HAVE_QDBM +#if defined(HAVE_QDBM) #include -#elif HAVE_GDBM +#elif defined(HAVE_GDBM) #include -#elif HAVE_DB4 +#elif defined(HAVE_DB4) #include #endif #endif @@ -236,11 +237,11 @@ static void show_version (void) #endif #ifdef USE_HCACHE -#if HAVE_QDBM +#if defined(HAVE_QDBM) printf (" qdbm %s\n", dpversion); -#elif HAVE_GDBM +#elif defined(HAVE_GDBM) printf (" gdbm %s\n", gdbm_version); -#elif HAVE_DB4 +#elif defined(HAVE_DB4) printf (" DB4 %d.%d.%d\n", DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH); #endif @@ -407,7 +408,7 @@ static void show_version (void) "-HAVE_LANGINFO_YESEXPR " #endif "\n " -#if HAVE_ICONV +#ifdef HAVE_ICONV "+HAVE_ICONV " #else "-HAVE_ICONV " @@ -417,17 +418,17 @@ static void show_version (void) #else "-ICONV_NONTRANS " #endif -#if HAVE_LIBIDN +#ifdef HAVE_LIBIDN "+HAVE_LIBIDN " #else "-HAVE_LIBIDN " #endif -#if HAVE_GETSID +#ifdef HAVE_GETSID "+HAVE_GETSID " #else "-HAVE_GETSID " #endif -#if HAVE_GETADDRINFO +#ifdef HAVE_GETADDRINFO "+HAVE_GETADDRINFO " #else "-HAVE_GETADDRINFO " @@ -481,10 +482,10 @@ static void start_curses (void) keypad (stdscr, TRUE); cbreak (); noecho (); -#if HAVE_TYPEAHEAD +#ifdef HAVE_TYPEAHEAD typeahead (-1); /* simulate smooth scrolling */ #endif -#if HAVE_META +#ifdef HAVE_META meta (stdscr, TRUE); #endif } @@ -518,7 +519,7 @@ int main (int argc, char **argv) int dump_variables = -1; /* initialize random number for tmp file creation */ - srand ((unsigned int) time (NULL)); + srand48((unsigned int) time (NULL)); /* sanity check against stupid administrators */ @@ -538,7 +539,7 @@ int main (int argc, char **argv) mutt_error = mutt_nocurses_error; mutt_message = mutt_nocurses_error; - SRAND (time (NULL)); + srand48 (time (NULL)); umask (077); p_clear(Options, countof(Options)); @@ -721,12 +722,12 @@ int main (int argc, char **argv) address_t *a; for (; alias_queries; alias_queries = alias_queries->next) { - if ((a = alias_lookup(Aliases, alias_queries->data))) { + if ((a = address_list_dup(alias_lookup(alias_queries->data)))) { /* output in machine-readable form */ mutt_addrlist_to_idna (a, NULL); mutt_write_address_list (a, stdout, 0, 0); - } - else { + address_list_wipe(&a); + } else { rv = 1; printf ("%s\n", alias_queries->data); }