From 30e5ee9995f53038802b892426753efa7aece15e Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 10 Nov 2024 13:01:53 +0100 Subject: [PATCH] move sanity check snippet --- source/main.c | 6 ------ source/opt.c | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/main.c b/source/main.c index 13bfa39..b6a8aa8 100644 --- a/source/main.c +++ b/source/main.c @@ -318,12 +318,6 @@ int main(int argc, char **argv) { /* read the environment */ readenv(); - /* XXX remove if/when clearerr() in dir.c does the right thing. */ - if(namefile && strcmp(namefile, "-") == 0 && !buildonly) { - postfatal(PROGRAM_NAME ": Must use -b if file list comes from stdin\n"); - /* NOTREACHED */ - } - /* make sure that tmpdir exists */ if(lstat(tmpdir, &stat_buf)) { fprintf(stderr, diff --git a/source/opt.c b/source/opt.c index 533987e..bb842e7 100644 --- a/source/opt.c +++ b/source/opt.c @@ -205,6 +205,14 @@ char **parse_options(int *argc, char **argv) { break; } } + + // Sanity checks + /* XXX remove if/when clearerr() in dir.c does the right thing. */ + if(namefile && strcmp(namefile, "-") == 0 && !buildonly) { + postfatal(PROGRAM_NAME ": Must use -b if file list comes from stdin\n"); + /* NOTREACHED */ + } + /* * This adjusts argv so that we only see the remaining * args. Its ugly, but we need to do it so that the rest