Fossil SCM
Fixed an off-by-one error affecting "fossil grep" when the final argument was left off.
Commit
f6502e8caec3e7a109dc08f78ccede034520232a21e3963a94c63619a3634bb8
Parent
729360ecc6d9ce1…
1 file changed
+1
-1
+1
-1
| --- src/regexp.c | ||
| +++ src/regexp.c | ||
| @@ -815,11 +815,11 @@ | ||
| 815 | 815 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 816 | 816 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 817 | 817 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 818 | 818 | db_find_and_open_repository(0, 0); |
| 819 | 819 | verify_all_options(); |
| 820 | - if( g.argc<3 ){ | |
| 820 | + if( g.argc<4 ){ | |
| 821 | 821 | usage("REGEXP FILENAME"); |
| 822 | 822 | } |
| 823 | 823 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 824 | 824 | if( zErr ) fossil_fatal("%s", zErr); |
| 825 | 825 | |
| 826 | 826 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -815,11 +815,11 @@ | |
| 815 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 816 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 817 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 818 | db_find_and_open_repository(0, 0); |
| 819 | verify_all_options(); |
| 820 | if( g.argc<3 ){ |
| 821 | usage("REGEXP FILENAME"); |
| 822 | } |
| 823 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 824 | if( zErr ) fossil_fatal("%s", zErr); |
| 825 | |
| 826 |
| --- src/regexp.c | |
| +++ src/regexp.c | |
| @@ -815,11 +815,11 @@ | |
| 815 | if( find_option("ignore-case","i",0)!=0 ) ignoreCase = 1; |
| 816 | if( find_option("files-with-matches","l",0)!=0 ) flags |= GREP_EXISTS; |
| 817 | if( find_option("verbose","v",0)!=0 ) bVerbose = 1; |
| 818 | db_find_and_open_repository(0, 0); |
| 819 | verify_all_options(); |
| 820 | if( g.argc<4 ){ |
| 821 | usage("REGEXP FILENAME"); |
| 822 | } |
| 823 | zErr = re_compile(&pRe, g.argv[2], ignoreCase); |
| 824 | if( zErr ) fossil_fatal("%s", zErr); |
| 825 | |
| 826 |