summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fcomp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fcomp.c b/fcomp.c
index bff6823..65f5812 100644
--- a/fcomp.c
+++ b/fcomp.c
@@ -144,6 +144,8 @@ static void print_help(char *argv0)
"Same");
fprintf(stderr, "%8s %4s %15s %50s\n", "-f", "[..]", "file",
"Select the input file to use");
+ fprintf(stderr, "%8s %4s %15s %50s\n", "-F", "[..]", "filestream",
+ "Input can be provided as a string");
fprintf(stderr, "%8s %4s %15s %50s\n", "stdin", "[..]", "",
"Input can come from rediretion as well as files");
fprintf(stderr, "%8s %4s %15s %50s\n", "-z", "", "fuzzy",
@@ -688,9 +690,11 @@ static int set_input(FILE **f)
if (!cfg.file || strcmp(cfg.file, "") == 0)
return -1;
*f = fmemopen(cfg.file, strlen(cfg.file), "r");
- } else {
+ if (!*f) return -1;
+ }
+ else {
*f = fopen(cfg.file, "r");
- if (!f) {
+ if (!*f) {
fprintf(stderr, "Couldn't open %s\n", cfg.file);
return -1;
}