Silence ENOENT for `-f'

This commit is contained in:
styan 2020-06-20 11:40:59 +00:00
parent 16a5bbc031
commit 1a87febe90
1 changed files with 4 additions and 1 deletions

View File

@ -69,8 +69,11 @@ main(int argc, char *argv[])
drecipe = optarg;
break;
case 'f':
if ((fp = fopen(optarg, "r")) == NULL)
if ((fp = fopen(optarg, "r")) == NULL) {
if (errno == 0 || errno == ENOENT)
break;
err(EX_NOINPUT, "%s", optarg);
}
for (j = 1;
(r = getdelim(&p, &i, '\n', fp)) > 0;
j++) {