X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fcontext_read.c;h=6a1eea1259cfbaa94ac75a41232ff8abb3387525;hb=b9d1fc0c85e9bd18e5e768913ba2c0a00f19876c;hp=d2524c7c3ec4e15159502498a9ccd1365cbea544;hpb=82a21b6f3cddf8ab048dcb02c080ea9797c73c5a;p=mmh diff --git a/sbr/context_read.c b/sbr/context_read.c index d2524c7..6a1eea1 100644 --- a/sbr/context_read.c +++ b/sbr/context_read.c @@ -28,8 +28,6 @@ #include /* system call errors */ #include /* structure for getpwuid() results */ -extern int errno; /* system call error number */ - void context_read (void) { @@ -122,11 +120,20 @@ 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"))) { readconfig ((struct node **) 0, ib, cp, 1); - lkfclose (ib); + lkfclose (ib, ctxpath); } return;