Add support for line ending detection in our diff parser.

Line endings are now preserved during the diff parsing. When the diff
is then rendered later on, we replace non-printable characters by their
ordinal counterparts, so a user can easily grasp changes when a hunk
comes with edits that might be invisible at first.

The expected format for the diff test suite has changed from serialized
PHP to var_export, which is easier readable, editable and understandable,
while still keeping parsable as well.

Support for old Macintosh line endings could not be added, mainly because
modern SCMs do not support single \r in their unified diff output either
and working around and parsing these "lines" would have been a major
headache with not much outcome (given the fact that all Macs that have been
sold since 2001 or 2002 have been BSD-based and as such used Unix line
endings by default).

This commit fixes issue 636.
This commit is contained in:
Thomas Keller 2011-10-05 02:44:04 +02:00
parent 1be91e5a2a
commit d0e2977746
23 changed files with 7905 additions and 405 deletions

View File

@ -35,9 +35,29 @@ class IDF_Diff
public function __construct($diff, $path_strip_level = 0) public function __construct($diff, $path_strip_level = 0)
{ {
$this->path_strip_level = $path_strip_level; $this->path_strip_level = $path_strip_level;
$this->lines = self::splitIntoLines($diff);
}
/**
* Splits a diff into separate lines while retaining the individual
* line ending character for every line
*/
private static function splitIntoLines($diff)
{
// this works because in unified diff format even empty lines are // this works because in unified diff format even empty lines are
// either prefixed with a '+', '-' or ' ' // either prefixed with a '+', '-' or ' '
$this->lines = preg_split("/\015\012|\015|\012/", $diff, -1, PREG_SPLIT_NO_EMPTY); $splitted = preg_split("/\r\n|\n/", $diff, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_OFFSET_CAPTURE);
$last_off = -1;
$lines = array();
while (($split = array_shift($splitted)) !== null) {
if ($last_off != -1) {
$lines[] .= substr($diff, $last_off, $split[1] - $last_off);
}
$last_off = $split[1];
}
$lines[] = substr($diff, $last_off);
return $lines;
} }
public function parse() public function parse()
@ -66,12 +86,12 @@ class IDF_Diff
} }
// use new file name by default // use new file name by default
preg_match("/^\+\+\+ ([^\t]+)/", $newfileline, $m); preg_match("/^\+\+\+ ([^\t\n\r]+)/", $newfileline, $m);
$current_file = $m[1]; $current_file = $m[1];
if ($current_file === '/dev/null') { if ($current_file === '/dev/null') {
// except if it's /dev/null, use the old one instead // except if it's /dev/null, use the old one instead
// eg. mtn 0.48 and newer // eg. mtn 0.48 and newer
preg_match("/^--- ([^\t]+)/", $oldfileline, $m); preg_match("/^--- ([^\t\r\n]+)/", $oldfileline, $m);
$current_file = $m[1]; $current_file = $m[1];
} }
if ($this->path_strip_level > 0) { if ($this->path_strip_level > 0) {
@ -102,10 +122,11 @@ class IDF_Diff
while ($i < $diffsize && ($addlines >= 0 || $dellines >= 0)) { while ($i < $diffsize && ($addlines >= 0 || $dellines >= 0)) {
$linetype = $this->lines[$i] != '' ? $this->lines[$i][0] : false; $linetype = $this->lines[$i] != '' ? $this->lines[$i][0] : false;
$content = substr($this->lines[$i], 1);
switch ($linetype) { switch ($linetype) {
case ' ': case ' ':
$files[$current_file]['chunks'][$current_chunk][] = $files[$current_file]['chunks'][$current_chunk][] =
array($delstart, $addstart, substr($this->lines[$i++], 1)); array($delstart, $addstart, $content);
$dellines--; $dellines--;
$addlines--; $addlines--;
$delstart++; $delstart++;
@ -113,23 +134,26 @@ class IDF_Diff
break; break;
case '+': case '+':
$files[$current_file]['chunks'][$current_chunk][] = $files[$current_file]['chunks'][$current_chunk][] =
array('', $addstart, substr($this->lines[$i++], 1)); array('', $addstart, $content);
$addlines--; $addlines--;
$addstart++; $addstart++;
break; break;
case '-': case '-':
$files[$current_file]['chunks'][$current_chunk][] = $files[$current_file]['chunks'][$current_chunk][] =
array($delstart, '', substr($this->lines[$i++], 1)); array($delstart, '', $content);
$dellines--; $dellines--;
$delstart++; $delstart++;
break; break;
case '\\': case '\\':
// ignore newline handling for now, see issue 636 // no new line at the end of this file; remove pseudo new line from last line
$i++; $cur = count($files[$current_file]['chunks'][$current_chunk]) - 1;
$files[$current_file]['chunks'][$current_chunk][$cur][2] =
rtrim($files[$current_file]['chunks'][$current_chunk][$cur][2], "\r\n");
continue; continue;
default: default:
break 2; break 2;
} }
$i++;
} }
$current_chunk++; $current_chunk++;
} }
@ -156,13 +180,15 @@ class IDF_Diff
foreach ($file['chunks'] as $chunk) { foreach ($file['chunks'] as $chunk) {
foreach ($chunk as $line) { foreach ($chunk as $line) {
if ($line[0] and $line[1]) { if ($line[0] and $line[1]) {
$class = 'diff-c'; $class = 'diff diff-c';
} elseif ($line[0]) { } elseif ($line[0]) {
$class = 'diff-r'; $class = 'diff diff-r';
} else { } else {
$class = 'diff-a'; $class = 'diff diff-a';
} }
$line_content = self::padLine(Pluf_esc($line[2])); $line_content = Pluf_esc($line[2]);
$line_content = preg_replace("/\t/", " ", $line_content);
$line_content = self::makeNonPrintableCharsVisible($line_content);
$out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="diff-lc">%s</td><td class="%s%s mono">%s</td></tr>'."\n", $line[0], $line[1], $class, $pretty, $line_content); $out .= sprintf('<tr class="diff-line"><td class="diff-lc">%s</td><td class="diff-lc">%s</td><td class="%s%s mono">%s</td></tr>'."\n", $line[0], $line[1], $class, $pretty, $line_content);
} }
if (count($file['chunks']) > $cc) if (count($file['chunks']) > $cc)
@ -174,6 +200,13 @@ class IDF_Diff
return Pluf_Template::markSafe($out); return Pluf_Template::markSafe($out);
} }
private static function makeNonPrintableCharsVisible($line)
{
return preg_replace('/([^[:print:]])/e',
'"<span class=\"non-printable\" title=\"0x".strtoupper(bin2hex("\\1"))."\">".bin2hex("\\1")."</span>"',
$line);
}
public static function padLine($line) public static function padLine($line)
{ {
$line = str_replace("\t", ' ', $line); $line = str_replace("\t", ' ', $line);
@ -208,7 +241,7 @@ class IDF_Diff
*/ */
public function fileCompare($orig, $chunks, $filename, $context=10) public function fileCompare($orig, $chunks, $filename, $context=10)
{ {
$orig_lines = preg_split("/\015\012|\015|\012/", $orig); $orig_lines = self::splitIntoLines($orig);
$new_chunks = $this->mergeChunks($orig_lines, $chunks, $context); $new_chunks = $this->mergeChunks($orig_lines, $chunks, $context);
return $this->renderCompared($new_chunks, $filename); return $this->renderCompared($new_chunks, $filename);
} }

View File

@ -38,11 +38,9 @@ class IDF_DiffTest extends PHPUnit_Framework_TestCase
} }
$expectedfile = str_replace('.diff', '.expected', $difffile); $expectedfile = str_replace('.diff', '.expected', $difffile);
$expectedcontent = @file_get_contents($expectedfile);
$diffcontent = file_get_contents($difffile); $diffcontent = file_get_contents($difffile);
$diff = new IDF_Diff($diffcontent, $diffprefix); $diff = new IDF_Diff($diffcontent, $diffprefix);
$this->assertEquals(unserialize($expectedcontent), $this->assertEquals(require_once($expectedfile),
$diff->parse(), $diff->parse(),
'parsed diff '.$difffile.' does not match'); 'parsed diff '.$difffile.' does not match');
} }

File diff suppressed because one or more lines are too long

View File

@ -15,375 +15,10 @@ Index: LinuxBIOSv1/src/include/cpu/i786/cpufixup.h
+ +
+ +
Eigenschaftsänderungen: LinuxBIOSv1\src\include\cpu\i786\cpufixup.h Eigenschafts<EFBFBD>nderungen: LinuxBIOSv1\src\include\cpu\i786\cpufixup.h
___________________________________________________________________ ___________________________________________________________________
Hinzugefügt: svn:keywords Hinzugef<EFBFBD>gt: svn:keywords
+ Author Date Id Revision + Author Date Id Revision
Hinzugefügt: svn:eol-style Hinzugef<EFBFBD>gt: svn:eol-style
+ native
Index: LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout
===================================================================
--- LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 0)
+++ LinuxBIOSv1/src/mainboard/tyan/guiness/cmos.layout (Revision 665)
@@ -0,0 +1,63 @@
+entries
+
+#start-bit length config config-ID name
+#0 8 r 0 seconds
+#8 8 r 0 alarm_seconds
+#16 8 r 0 minutes
+#24 8 r 0 alarm_minutes
+#32 8 r 0 hours
+#40 8 r 0 alarm_hours
+#48 8 r 0 day_of_week
+#56 8 r 0 day_of_month
+#64 8 r 0 month
+#72 8 r 0 year
+#80 4 r 0 rate_select
+#84 3 r 0 REF_Clock
+#87 1 r 0 UIP
+#88 1 r 0 auto_switch_DST
+#89 1 r 0 24_hour_mode
+#90 1 r 0 binary_values_enable
+#91 1 r 0 square-wave_out_enable
+#92 1 r 0 update_finished_enable
+#93 1 r 0 alarm_interrupt_enable
+#94 1 r 0 periodic_interrupt_enable
+#95 1 r 0 disable_clock_updates
+#96 288 r 0 temporary_filler
+0 384 r 0 reserved_memory
+384 1 e 4 boot_option
+385 1 e 4 last_boot
+386 3 e 5 baud_rate
+392 4 e 6 debug_level
+396 1 e 1 power_on_after_fail
+#401 1 e 1 ECC_memory
+#402 1 e 2 hda_disk
+#403 1 e 2 hdb_disk
+#404 1 e 2 hdc_disk
+#405 1 e 2 hdd_disk
+#406 2 e 7 boot_device
+
+enumerations
+
+#ID value text
+1 0 Disable
+1 1 Enable
+#2 0 No
+#2 1 Yes
+4 0 Fallback
+4 1 Normal
+5 0 115200
+5 1 57600
+5 2 38400
+5 3 19200
+5 4 9600
+5 5 4800
+5 6 2400
+5 7 1200
+6 6 Notice
+6 7 Info
+6 8 Debug
+6 9 Spew
+#7 0 Network
+#7 1 HDD
+#7 2 Floppy
+#7 3 ROM
Eigenschaftsänderungen: LinuxBIOSv1\src\mainboard\tyan\guiness\cmos.layout
___________________________________________________________________
Hinzugefügt: svn:keywords
+ Author Date Id Revision
Hinzugefügt: svn:eol-style
+ native
Index: LinuxBIOSv1/src/config/linuxbios_c.ld
===================================================================
--- LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 0)
+++ LinuxBIOSv1/src/config/linuxbios_c.ld (Revision 665)
@@ -0,0 +1,105 @@
+/*
+ * Memory map:
+ *
+ * _RAMBASE
+ * : data segment
+ * : bss segment
+ * : heap
+ * : stack
+ */
+/*
+ * Bootstrap code for the STPC Consumer
+ * Copyright (c) 1999 by Net Insight AB. All Rights Reserved.
+ *
+ * $Id$
+ *
+ */
+
+/*
+ * Written by Johan Rydberg, based on work by Daniel Kahlin.
+ * Rewritten by Eric Biederman
+ */
+/*
+ * We use ELF as output format. So that we can
+ * debug the code in some form.
+ */
+INCLUDE ldoptions
+
+ENTRY(_start)
+
+SECTIONS
+{
+ . = _RAMBASE;
+ /*
+ * First we place the code and read only data (typically const declared).
+ * This get placed in rom.
+ */
+ .text : {
+ _text = .;
+ *(.text);
+ *(.text.*);
+ . = ALIGN(16);
+ _etext = .;
+ }
+ .rodata : {
+ _rodata = .;
+ . = ALIGN(4);
+ streams = . ;
+ *(.rodata.streams)
+ estreams = .;
+ . = ALIGN(4);
+ pci_drivers = . ;
+ *(.rodata.pci_drivers)
+ epci_drivers = . ;
+ *(.rodata)
+ *(.rodata.*)
+ _erodata = .;
+ }
+ /*
+ * After the code we place initialized data (typically initialized
+ * global variables). This gets copied into ram by startup code.
+ * __data_start and __data_end shows where in ram this should be placed,
+ * whereas __data_loadstart and __data_loadend shows where in rom to
+ * copy from.
+ */
+ .data : {
+ _data = .;
+ *(.data)
+ _edata = .;
+ }
+ /*
+ * bss does not contain data, it is just a space that should be zero
+ * initialized on startup. (typically uninitialized global variables)
+ * crt0.S fills between _bss and _ebss with zeroes.
+ */
+ _bss = .;
+ .bss . : {
+ *(.bss)
+ *(.sbss)
+ *(COMMON)
+ }
+ _ebss = .;
+ _end = .;
+ _stack = .;
+ .stack . : {
+ /* Reserve a stack for each possible cpu, +1 extra */
+ . = ((MAX_CPUS * STACK_SIZE) + STACK_SIZE) ;
+ }
+ _estack = .;
+ _heap = .;
+ .heap . : {
+ /* Reserve 256K for the heap */
+ . = HEAP_SIZE ;
+ . = ALIGN(4);
+ }
+ _eheap = .;
+ /* The ram segment
+ * This is all address of the memory resident copy of linuxBIOS.
+ */
+ _ram_seg = _text;
+ _eram_seg = _eheap;
+ /DISCARD/ : {
+ *(.comment)
+ *(.note)
+ }
+}
Eigenschaftsänderungen: LinuxBIOSv1\src\config\linuxbios_c.ld
___________________________________________________________________
Hinzugefügt: svn:keywords
+ Author Date Id Revision
Hinzugefügt: svn:eol-style
+ native
Index: LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h
===================================================================
--- LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 0)
+++ LinuxBIOSv1/src/arch/i386/include/arch/rom_segs.h (Revision 665)
@@ -0,0 +1,10 @@
+#ifndef ROM_SEGS_H
+#define ROM_SEGS_H
+
+#define ROM_CODE_SEG 0x08
+#define ROM_DATA_SEG 0x10
+
+#define CACHE_RAM_CODE_SEG 0x18
+#define CACHE_RAM_DATA_SEG 0x20
+
+#endif /* ROM_SEGS_H */
Eigenschaftsänderungen: LinuxBIOSv1\src\arch\i386\include\arch\rom_segs.h
___________________________________________________________________
Hinzugefügt: svn:keywords
+ Author Date Id Revision
Hinzugefügt: svn:eol-style
+ native
Index: LinuxBIOSv1/src/arch/i386/lib/c_start.S
===================================================================
--- LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 0)
+++ LinuxBIOSv1/src/arch/i386/lib/c_start.S (Revision 665)
@@ -0,0 +1,135 @@
+#include <arch/asm.h>
+#include <arch/intel.h>
+#ifdef SMP
+#include <cpu/p6/apic.h>
+#endif
+ .section ".text"
+ .code32
+ .globl _start
+_start:
+ cli
+ lgdt %cs:gdtaddr
+ ljmp $0x10, $1f
+1: movl $0x18, %ax
+ movl %eax, %ds
+ movl %eax, %es
+ movl %eax, %ss
+ movl %eax, %fs
+ movl %eax, %gs
+
+ intel_chip_post_macro(0x13) /* post 12 */
+
+ /** clear stack */
+ leal EXT(_stack), %edi
+ movl $EXT(_estack), %ecx
+ subl %edi, %ecx
+ xorl %eax, %eax
+ rep
+ stosb
+
+ /** clear bss */
+ leal EXT(_bss), %edi
+ movl $EXT(_ebss), %ecx
+ subl %edi, %ecx
+ jz .Lnobss
+ xorl %eax, %eax
+ rep
+ stosb
+.Lnobss:
+
+ /* set new stack */
+ movl $_estack, %esp
+#ifdef SMP
+ /* Get the cpu id */
+ movl $APIC_DEFAULT_BASE, %edi
+ movl APIC_ID(%edi), %eax
+ shrl $24, %eax
+
+ /* Get the cpu index (MAX_CPUS on error) */
+ movl $-4, %ebx
+1: addl $4, %ebx
+ cmpl $(MAX_CPUS << 2), %ebx
+ je 2
+ cmpl %eax, EXT(initial_apicid)(%ebx)
+ jne 1b
+2: shrl $2, %ebx
+
+ /* Now compute the appropriate stack */
+ movl %ebx, %eax
+ movl $STACK_SIZE, %ebx
+ mull %ebx
+ subl %eax, %esp
+
+ /* push the boot_complete flag */
+ pushl %ebp
+
+ /* Save the stack location */
+ movl %esp, %ebp
+
+ /*
+ * Now we are finished. Memory is up, data is copied and
+ * bss is cleared. Now we call the main routine and
+ * let it do the rest.
+ */
+ intel_chip_post_macro(0xfe) /* post fe */
+
+ /* Resort the stack location */
+ movl %ebp, %esp
+
+ /* The boot_complete flag has already been pushed */
+ call EXT(hardwaremain)
+ /*NOTREACHED*/
+.Lhlt:
+ intel_chip_post_macro(0xee) /* post fe */
+ hlt
+ jmp .Lhlt
+#endif
+
+
+ .globl gdt, gdt_end, gdt_limit
+
+gdt_limit = gdt_end - gdt - 1 /* compute the table limit */
+gdtaddr:
+ .word gdt_limit
+ .long gdt /* we know the offset */
+
+gdt:
+// selgdt 0
+ .word 0x0000, 0x0000 /* dummy */
+ .byte 0x00, 0x00, 0x00, 0x00
+
+// selgdt 8
+ .word 0x0000, 0x0000 /* dummy */
+ .byte 0x00, 0x00, 0x00, 0x00
+
+// selgdt 0x10
+/* flat code segment */
+ .word 0xffff, 0x0000
+ .byte 0x00, 0x9b, 0xcf, 0x00
+
+//selgdt 0x18
+/* flat data segment */
+ .word 0xffff, 0x0000
+ .byte 0x00, 0x93, 0xcf, 0x00
+
+//selgdt 0x20
+ .word 0x0000, 0x0000 /* dummy */
+ .byte 0x00, 0x00, 0x00, 0x00
+
+#if defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
+ // from monty:
+ /* 0x00009a00,0000ffffULL, 20h: 16-bit 64k code at 0x00000000 */
+ /* 0x00009200,0000ffffULL 28h: 16-bit 64k data at 0x00000000 */
+// selgdt 0x28
+/*16-bit 64k code at 0x00000000 */
+ .word 0xffff, 0x0000
+ .byte 0, 0x9a, 0, 0
+
+// selgdt 0x30
+/*16-bit 64k data at 0x00000000 */
+ .word 0xffff, 0x0000
+ .byte 0, 0x92, 0, 0
+#endif // defined(CONFIG_VGABIOS) && (CONFIG_VGABIOS == 1)
+gdt_end:
+
+.code32
Eigenschaftsänderungen: LinuxBIOSv1\src\arch\i386\lib\c_start.S
___________________________________________________________________
Hinzugefügt: svn:keywords
+ Author Date Id Revision
Hinzugefügt: svn:eol-style
+ native + native

File diff suppressed because one or more lines are too long

View File

@ -1 +1,33 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "abc\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '0',
1 => '0',
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "abc\r\n",
),
1 =>
array (
0 => '',
1 => 2,
2 => "abc\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '0',
1 => '0',
),
1 =>
array (
0 => '1',
1 => '2',
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:3:"abc";}i:1;a:3:{i:0;i:2;i:1;s:0:"";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"2";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "abc\r\n",
),
1 =>
array (
0 => 2,
1 => '',
2 => "abc\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '2',
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:3:"abc";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '',
2 => "abc\r\n",
),
1 =>
array (
0 => '',
1 => '1',
2 => "ls\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => 1,
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:2:"ls";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:2:"ls";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "ls\r\n",
),
1 =>
array (
0 => '',
1 => 2,
2 => "ls\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => 1,
),
1 =>
array (
0 => '1',
1 => '2',
),
),
),
),
);

View File

@ -1 +1,45 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:2:"ls";}i:1;a:3:{i:0;i:2;i:1;i:2;i:2;s:2:"ls";}i:2;a:3:{i:0;s:0:"";i:1;i:3;i:2;s:1:"l";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"2";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"3";}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "ls\r\n",
),
1 =>
array (
0 => 2,
1 => 2,
2 => "ls\r\n",
),
2 =>
array (
0 => '',
1 => 3,
2 => "l\r\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '2',
),
1 =>
array (
0 => '1',
1 => '3',
),
),
),
),
);

View File

@ -1 +1,33 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"1";}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "foo\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '0',
1 => '0',
),
1 =>
array (
0 => '1',
1 => '1',
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:3:"foo";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:2:"bf";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"1";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"2";}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "foo\n",
),
1 =>
array (
0 => '',
1 => 2,
2 => "bf\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
),
1 =>
array (
0 => '1',
1 => '2',
),
),
),
),
);

View File

@ -1 +1,33 @@
a:1:{s:1:"a";a:2:{s:6:"chunks";a:1:{i:0;a:1:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:3:"abc";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'a' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "abc\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '0',
1 => '0',
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,45 @@
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:1:"b";}i:2;a:3:{i:0;s:0:"";i:1;i:3;i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"0";i:1;s:1:"0";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"3";}}}}} <?php return array (
'b' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "a\n",
),
1 =>
array (
0 => '',
1 => 2,
2 => "b\n",
),
2 =>
array (
0 => '',
1 => 3,
2 => "\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '0',
1 => '0',
),
1 =>
array (
0 => '1',
1 => '3',
),
),
),
),
);

View File

@ -1 +1,51 @@
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:4:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;s:0:"";i:1;i:2;i:2;s:1:"l";}i:2;a:3:{i:0;i:2;i:1;i:3;i:2;s:1:"b";}i:3;a:3:{i:0;i:3;i:1;i:4;i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"3";}i:1;a:2:{i:0;s:1:"1";i:1;s:1:"4";}}}}} <?php return array (
'b' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "a\n",
),
1 =>
array (
0 => '',
1 => 2,
2 => "l\n",
),
2 =>
array (
0 => 2,
1 => 3,
2 => "b\n",
),
3 =>
array (
0 => 3,
1 => 4,
2 => "\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '3',
),
1 =>
array (
0 => '1',
1 => '4',
),
),
),
),
);

View File

@ -1 +1,45 @@
a:1:{s:1:"b";a:2:{s:6:"chunks";a:1:{i:0;a:3:{i:0;a:3:{i:0;s:1:"1";i:1;s:1:"1";i:2;s:1:"a";}i:1;a:3:{i:0;i:2;i:1;s:0:"";i:2;s:1:"b";}i:2;a:3:{i:0;i:3;i:1;s:0:"";i:2;b:0;}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;s:1:"3";}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'b' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '1',
2 => "a\n",
),
1 =>
array (
0 => 2,
1 => '',
2 => "b\n",
),
2 =>
array (
0 => 3,
1 => '',
2 => "\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '3',
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:9:"test_file";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:17:"Steddy is awesome";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:22:"Steddy is very awesome";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'test_file' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '',
2 => "Steddy is awesome\n",
),
1 =>
array (
0 => '',
1 => '1',
2 => 'Steddy is very awesome',
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => 1,
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:3:"foo";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:11:"This is foo";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:11:"This is foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'foo' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '',
2 => "This is foo\n",
),
1 =>
array (
0 => '',
1 => '1',
2 => 'This is foo',
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => 1,
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -1 +1,39 @@
a:1:{s:3:"foo";a:2:{s:6:"chunks";a:1:{i:0;a:2:{i:0;a:3:{i:0;s:1:"1";i:1;s:0:"";i:2;s:11:"This is foo";}i:1;a:3:{i:0;s:0:"";i:1;s:1:"1";i:2;s:11:"This is foo";}}}s:10:"chunks_def";a:1:{i:0;a:2:{i:0;a:2:{i:0;s:1:"1";i:1;i:1;}i:1;a:2:{i:0;s:1:"1";i:1;i:1;}}}}} <?php return array (
'foo' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '',
2 => "This is foo",
),
1 =>
array (
0 => '',
1 => '1',
2 => "This is foo\n",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => 1,
),
1 =>
array (
0 => '1',
1 => 1,
),
),
),
),
);

View File

@ -0,0 +1,10 @@
diff --git a/lineendings b/lineendings
index 7c2b7ec..9c59944 100644
--- a/lineendings
+++ b/lineendings
@@ -1,3 +1,4 @@
+Unix, again
Windows
Unix
Old Macintosh Nothing
\ No newline at end of file

View File

@ -0,0 +1,51 @@
<?php return array (
'lineendings' =>
array (
'chunks' =>
array (
0 =>
array (
0 =>
array (
0 => '',
1 => '1',
2 => "Unix, again\n",
),
1 =>
array (
0 => '1',
1 => 2,
2 => "Windows\r\n",
),
2 =>
array (
0 => 2,
1 => 3,
2 => "Unix\n",
),
3 =>
array (
0 => 3,
1 => 4,
2 => "Old Macintosh\rNothing",
),
),
),
'chunks_def' =>
array (
0 =>
array (
0 =>
array (
0 => '1',
1 => '3',
),
1 =>
array (
0 => '1',
1 => '4',
),
),
),
),
);

View File

@ -614,18 +614,56 @@ td.diff-r {
background-color: #fdd; background-color: #fdd;
} }
td.diff-a, td.diff-r, td.diff-c { td.diff {
border-bottom: none; border-bottom: none;
border-top: none; border-top: none;
white-space: pre; white-space: pre;
} }
td.diff-a > span, td.diff > span {
td.diff-r > span,
td.diff-c > span {
float: left; float: left;
} }
td.diff > span.non-printable {
visibility: hidden;
color: white;
text-transform: uppercase;
float: none;
font-size: 5.5pt;
font-family: Calibri, Helvetica, Arial, sans-serif;
text-align: center;
display: inline-block;
word-wrap: break-word;
padding: 1px 1px 0px 1px;
margin-left: 1px;
margin-right: 1px;
-moz-border-radius: 2px;
-webkit-border-radius: 2px;
cursor: default;
vertical-align: 10%;
}
td.diff:hover > span.non-printable {
visibility: visible;
}
td.diff-a > span.non-printable {
background: #0A0;
}
td.diff-r > span.non-printable {
background: #A00;
}
td.diff-c > span.non-printable {
background: black;
}
/* override prettify css rule */
td.diff > span.non-printable > * {
color: white;
}
table.diff tr.diff-next { table.diff tr.diff-next {
background-color: #e4e8E0; background-color: #e4e8E0;
vertical-align: top; vertical-align: top;