Update of /cvsroot/phpcvsview/phpcvsview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30827
Modified Files:
func_DiffFile.php
Log Message:
Fixed the fault where more lines were removed than added when the DIFF specifies a change ('c').
Index: func_DiffFile.php
===================================================================
RCS file: /cvsroot/phpcvsview/phpcvsview/func_DiffFile.php,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** func_DiffFile.php 2 Feb 2005 11:56:18 -0000 1.1
--- func_DiffFile.php 3 Feb 2005 07:29:50 -0000 1.2
***************
*** 109,116 ****
for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++)
{
! $linenumber++;
! $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2));
! InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset);
! $LineOffset++;
$FilePatching[$InsertLocation[0]-2+$LineCounter+$LineOffset]['mode'] = '-';
}
--- 109,118 ----
for ($LineCounter = 0; $LineCounter < $InsertLength; $LineCounter++)
{
! if ($LineCounter < $NewLineLength) {
! $linenumber++;
! $TempLine = array('mode' => "+", 'text' => substr($DiffLines[$linenumber], 2));
! InsertIntoArray(&$FilePatching, $TempLine, $InsertLocation[0]+$LineCounter+$LineOffset);
! $LineOffset++;
! }
$FilePatching[$InsertLocation[0]-2+$LineCounter+$LineOffset]['mode'] = '-';
}
|