Browse Source

Fix default old/new address when they are missing

Matthew Wang 9 years ago
parent
commit
7bf5bec0fc
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      cdiff.py

+ 2
- 2
cdiff.py View File

162
             old_addr = (int(a[0][1:]), int(a[1]))
162
             old_addr = (int(a[0][1:]), int(a[1]))
163
         else:
163
         else:
164
             # @@ -1 +1,2 @@
164
             # @@ -1 +1,2 @@
165
-            old_addr = (int(a[0][1:]), 0)
165
+            old_addr = (int(a[0][1:]), 1)
166
 
166
 
167
         b = hunk_meta.split()[2].split(',')   # +3 6
167
         b = hunk_meta.split()[2].split(',')   # +3 6
168
         if len(b) > 1:
168
         if len(b) > 1:
169
             new_addr = (int(b[0][1:]), int(b[1]))
169
             new_addr = (int(b[0][1:]), int(b[1]))
170
         else:
170
         else:
171
             # @@ -0,0 +1 @@
171
             # @@ -0,0 +1 @@
172
-            new_addr = (int(b[0][1:]), 0)
172
+            new_addr = (int(b[0][1:]), 1)
173
 
173
 
174
         return (old_addr, new_addr)
174
         return (old_addr, new_addr)
175
 
175