From 1819d9c3a61b89d2e0b2be8c44adebf04aad70db Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Sun, 1 Oct 2000 19:39:30 +0000 Subject: [PATCH] don't abort of configfile does not exist --- lib/myopt.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/myopt.c b/lib/myopt.c index c8e0a3c2..7ae3e175 100644 --- a/lib/myopt.c +++ b/lib/myopt.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -31,7 +32,11 @@ void myfileopt(const char* fn, const struct cmdinfo* cmdinfos) { char linebuf[MAXDIVERTFILENAME]; file= fopen(fn, "r"); - if (!file) ohshite(_("failed to open configuration file `%.255s' for reading"), fn); + if (!file) { + if (errno==ENOENT) + return; + ohshite(_("failed to open configuration file `%.255s' for reading"), fn); + } while (fgets(linebuf, sizeof(linebuf), file)) { char* opt; -- 2.39.5