From: Wichert Akkerman Date: Sun, 1 Oct 2000 19:39:30 +0000 (+0000) Subject: don't abort of configfile does not exist X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1819d9c3a61b89d2e0b2be8c44adebf04aad70db;p=dpkg don't abort of configfile does not exist --- 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;