| ... | ... |
@@ -4,6 +4,7 @@ |
| 4 | 4 |
#include <stdlib.h> |
| 5 | 5 |
#include <ctype.h> |
| 6 | 6 |
#include <getopt.h> |
| 7 |
+#include <limits.h> |
|
| 7 | 8 |
|
| 8 | 9 |
#include "match.h" |
| 9 | 10 |
#include "tty.h" |
| ... | ... |
@@ -222,7 +223,9 @@ int main(int argc, char *argv[]){
|
| 222 | 223 |
case 'l': |
| 223 | 224 |
{
|
| 224 | 225 |
int l; |
| 225 |
- if(sscanf(optarg, "%d", &l) != 1 || l < 3){
|
|
| 226 |
+ if(!strcmp(optarg, "max")){
|
|
| 227 |
+ l = INT_MAX; |
|
| 228 |
+ }else if(sscanf(optarg, "%d", &l) != 1 || l < 3){
|
|
| 226 | 229 |
fprintf(stderr, "Invalid format for --lines: %s\n", optarg); |
| 227 | 230 |
fprintf(stderr, "Must be integer in range 3..\n"); |
| 228 | 231 |
usage(argv[0]); |