X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Fcontext_read.c;h=fcc12f99c29c9037a75ef9bdbb3af480b2536a04;hb=0e7106da702d97e10f3bd24d8284a2ab86044ebd;hp=e6cdfff03f275abe1f2810fddf4b30ba5b92ccc2;hpb=5afa7072e3fe7fc42287e2149e1c23b363700795;p=mmh diff --git a/sbr/context_read.c b/sbr/context_read.c index e6cdfff..fcc12f9 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,17 @@ 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 */ + if (!cp) { + ctxpath = NULL; + return; + } + ctxpath = getcpy (m_maildir (cp)); - if ((ib = fopen (ctxpath, "r"))) { + if ((ib = lkfopen (ctxpath, "r"))) { readconfig ((struct node **) 0, ib, cp, 1); - fclose (ib); + lkfclose (ib, ctxpath); } return;