Skip to content

Commit

Permalink
Preliminary fix for passing non-file files to -f
Browse files Browse the repository at this point in the history
  • Loading branch information
halosghost committed Jul 15, 2016
1 parent 16a558d commit bd464d6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ main (signed argc, char * argv []) {
goto cleanup;
}

if ( !S_ISREG(st.st_mode) ) {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdisabled-macro-expansion"
fprintf(stderr, "pbpst: %s is not a regular file\n", state.path);
#pragma clang diagnostic pop
}

if ( st.st_size > PB_FILE_MAX ) {
fputs("pbpst: File too large\n", stderr);
exit_status = EXIT_FAILURE; goto cleanup;
Expand Down

0 comments on commit bd464d6

Please sign in to comment.