tRemoving the warnings for cfg. This needs better logic. - rohrpost - A commandline mail client to change the world as we see it.
 (HTM) git clone git://r-36.net/rohrpost
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) LICENSE
       ---
 (DIR) commit 3d1393ab7719d2e9f3b6d6f3003369fb4f3527eb
 (DIR) parent d12066fb46f960728396efe124aa7c4d592e2366
 (HTM) Author: Christoph Lohmann <20h@r-36.net>
       Date:   Sun,  9 Dec 2012 21:32:53 +0100
       
       Removing the warnings for cfg. This needs better logic.
       
       Diffstat:
         cfg.c                               |      10 ++--------
         inc.c                               |       8 +-------
         mark.c                              |       9 +--------
       
       3 files changed, 4 insertions(+), 23 deletions(-)
       ---
 (DIR) diff --git a/cfg.c b/cfg.c
       t@@ -10,6 +10,7 @@
        #include <string.h>
        #include <strings.h>
        #include <errno.h>
       +#include <libgen.h>
        
        #include "ind.h"
        #include "arg.h"
       t@@ -62,15 +63,8 @@ config_init(char *cfgn)
                cfg = config_read(path);
                free(path);
        
       -        if (cfg == NULL) {
       -                if (!strcmp(cfgn, "default")) {
       -                        die("No default config is set and no cfg was given."
       -                                " Please use $(rpcfg -e cfg) to set the"
       -                                " default configuration.\n");
       -                }
       -
       +        if (cfg == NULL)
                        cfg = config_new();
       -        }
        
                cfg->name = memdup(cfgn, strlen(cfgn)+1);
        
 (DIR) diff --git a/inc.c b/inc.c
       t@@ -46,14 +46,8 @@ inc_init(char *cfgn)
                incs = inc_read(path);
                free(path);
        
       -        if (incs == NULL) {
       -                if (!strcmp(cfgn, "default")) {
       -                        die("No default config is set and no cfg was given."
       -                                " Please use $(rpcfg -e cfg) to set the"
       -                                " default configuration.\n");
       -                }
       +        if (incs == NULL)
                        incs = inc_new();
       -        }
        
                incs->name = memdup(cfgn, strlen(cfgn)+1);
        
 (DIR) diff --git a/mark.c b/mark.c
       t@@ -46,15 +46,8 @@ mark_init(char *cfgn, char *mailbox)
                marks = mark_read(path);
                free(path);
        
       -        if (marks == NULL) {
       -                if (!strcmp(cfgn, "default")) {
       -                        die("No default config is set and no cfg was given."
       -                                " Please use $(rpcfg -e cfg) to set the"
       -                                " default configuration.\n");
       -                }
       -
       +        if (marks == NULL)
                        marks = mark_new();
       -        }
        
                marks->data = memdup(mailbox, strlen(mailbox)+1);
                marks->name = memdup(cfgn, strlen(cfgn)+1);