##// END OF EJS Templates
grep: don't search past the end of the searched string...
Idan Kamara -
r17931:35ba170c stable
parent child Browse files
Show More
@@ -2935,7 +2935,7 b' def grep(ui, repo, pattern, *pats, **opt'
2935 def matchlines(body):
2935 def matchlines(body):
2936 begin = 0
2936 begin = 0
2937 linenum = 0
2937 linenum = 0
2938 while True:
2938 while True and begin < len(body):
2939 match = regexp.search(body, begin)
2939 match = regexp.search(body, begin)
2940 if not match:
2940 if not match:
2941 break
2941 break
@@ -23,6 +23,10 b' pattern error'
23
23
24 simple
24 simple
25
25
26 $ hg grep '.*'
27 port:4:export
28 port:4:vaportight
29 port:4:import/export
26 $ hg grep port port
30 $ hg grep port port
27 port:4:export
31 port:4:export
28 port:4:vaportight
32 port:4:vaportight
General Comments 0
You need to be logged in to leave comments. Login now