move sanity check snippet

This commit is contained in:
anon 2024-11-10 13:01:53 +01:00
parent 037bc6f8ee
commit 30e5ee9995
2 changed files with 8 additions and 6 deletions

View File

@ -318,12 +318,6 @@ int main(int argc, char **argv) {
/* read the environment */ /* read the environment */
readenv(); 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 */ /* make sure that tmpdir exists */
if(lstat(tmpdir, &stat_buf)) { if(lstat(tmpdir, &stat_buf)) {
fprintf(stderr, fprintf(stderr,

View File

@ -205,6 +205,14 @@ char **parse_options(int *argc, char **argv) {
break; 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 * This adjusts argv so that we only see the remaining
* args. Its ugly, but we need to do it so that the rest * args. Its ugly, but we need to do it so that the rest