summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fzy.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fzy.c b/fzy.c
index c97829d..d71c95c 100644
--- a/fzy.c
+++ b/fzy.c
@@ -4,6 +4,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <getopt.h>
+#include <limits.h>
#include "match.h"
#include "tty.h"
@@ -222,7 +223,9 @@ int main(int argc, char *argv[]){
case 'l':
{
int l;
- if(sscanf(optarg, "%d", &l) != 1 || l < 3){
+ if(!strcmp(optarg, "max")){
+ l = INT_MAX;
+ }else if(sscanf(optarg, "%d", &l) != 1 || l < 3){
fprintf(stderr, "Invalid format for --lines: %s\n", optarg);
fprintf(stderr, "Must be integer in range 3..\n");
usage(argv[0]);