# HG changeset patch # User Bryan O'Sullivan # Date 1154725222 25200 # Node ID e3894bb9d1f5285e01f67a0538cc06ff09f84efc # Parent d12a199ed472110a75c2349bf54f862ee1061eaa Fix bugs in check_whitespace.py. diff -r d12a199ed472 -r e3894bb9d1f5 en/examples/data/check_whitespace.py --- a/en/examples/data/check_whitespace.py Fri Aug 04 13:43:26 2006 -0700 +++ b/en/examples/data/check_whitespace.py Fri Aug 04 14:00:22 2006 -0700 @@ -7,18 +7,18 @@ for line in difflines: if header: + # remember the name of the file that this diff affects + m = re.match(r'(?:---|\+\+\+) ([^\t]+)', line) + if m and m.group(1) != '/dev/null': + filename = m.group(1).split('/', 1)[-1] if line.startswith('+++ '): header = False - else: - # remember the name of the file that this diff affects - m = re.match(r'--- [^/]/([^\t])', line) - if m: filename = m.group(1) continue if line.startswith('diff '): header = True continue # hunk header - save the line number - m = re.match(r'@@ -(\d+),', line) + m = re.match(r'@@ -\d+,\d+ \+(\d+),', line) if m: linenum = int(m.group(1)) continue