Browse Source

Should tolerate dos format

Matthew Wang 11 years ago
parent
commit
b87376fac9
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      cdiff.py

+ 2
- 2
cdiff.py View File

480
 
480
 
481
         if size >= 4 and (header[0].startswith('*** ') and
481
         if size >= 4 and (header[0].startswith('*** ') and
482
                           header[1].startswith('--- ') and
482
                           header[1].startswith('--- ') and
483
-                          header[2] == '***************\n' and
483
+                          header[2].rstrip() == '***************' and
484
                           header[3].startswith('*** ') and
484
                           header[3].startswith('*** ') and
485
-                          header[3].endswith(' ****\n')):
485
+                          header[3].rstrip().endswith(' ****')):
486
             self._type = 'context'
486
             self._type = 'context'
487
             return
487
             return
488
 
488