Skip to content

Commit ac704f0

Browse files
committed
other diff parser bug
1 parent 1e62b54 commit ac704f0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

GLFileView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,8 @@ + (NSString *)parseDiff:(NSString *)txt
297297
NSScanner *scan=[NSScanner scannerWithString:txt];
298298
NSString *block;
299299

300-
[scan scanUpToString:@"\ndiff --git" intoString:NULL]; //move to first diff
300+
if(![txt hasPrefix:@"diff --git"])
301+
[scan scanUpToString:@"diff --git" intoString:&block]; //move to first diff
301302

302303
while([scan scanString:@"diff --git" intoString:NULL]){ // is a diff start?
303304
[scan scanUpToString:@"\ndiff --git" intoString:&block];

0 commit comments

Comments
 (0)