##// END OF EJS Templates
grep: don't search past the end of the searched string...
Idan Kamara -
r17923:1e6b5faf default
parent child Browse files
Show More
@@ -2936,7 +2936,7 b' def grep(ui, repo, pattern, *pats, **opt'
2936 def matchlines(body):
2936 def matchlines(body):
2937 begin = 0
2937 begin = 0
2938 linenum = 0
2938 linenum = 0
2939 while True:
2939 while True and begin < len(body):
2940 match = regexp.search(body, begin)
2940 match = regexp.search(body, begin)
2941 if not match:
2941 if not match:
2942 break
2942 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