X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fcontext_read.c;h=6a1eea1259cfbaa94ac75a41232ff8abb3387525;hb=8a5d5abeee6212629a14bd80abe2c97a07d609fb;hp=3084ff531a19174573fd4f4476d68cff7041ce5d;hpb=4885712264980e6cbc2039f9158027bee9213475;p=mmh diff --git a/sbr/context_read.c b/sbr/context_read.c index 3084ff5..6a1eea1 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -120,6 +120,15 @@ context_read (void) if ((cp = getenv ("MHCONTEXT")) == (char *)0 || *cp == '\0') cp = context; + /* context is NULL if context_foil() was called to disable use of context + * We also support users setting explicitly setting MHCONTEXT to /dev/null. + * (if this wasn't specialcased then the locking would be liable to fail) + */ + if (!cp || (strcmp(cp,"/dev/null") == 0)) { + ctxpath = NULL; + return; + } + ctxpath = getcpy (m_maildir (cp)); if ((ib = lkfopen (ctxpath, "r"))) {