Re: [dev] [sbase] diff

From: Mattias Andrée <>
Date: Sun, 21 Feb 2016 20:16:48 +0100

On Thu, 28 Jan 2016 16:48:22 +0100
Markus Wichmann <> wrote:

> The two files to be compared are loaded into memory,
> whereby each line is annotated with its line number
> (actually, that's a lie, busybox only saves a hash of the
> line and really, really hopes, there are no collisions,
> but hush). Then both files are sorted by line content
> first and line number second. Then a mapping is
> calculated, that maps each line of the old file to its
> corresponding line in the new one, if any. This is done
> by merging the two files, i. e. (pseudocode)
> memset(map, -1, sizeof map)
> new file pointer = first new line
> for every old line:
> while (*new file pointer < old line)
> new file pointer ++
> if (*new file pointer == old line)
> map[old line number] = new line number

I'm working on implementing it. But there is something
wrong with my code. Would you mind reviewing the
implementation (one function)?

Received on Sun Feb 21 2016 - 20:16:48 CET

This archive was generated by hypermail 2.3.0 : Sun Feb 21 2016 - 20:24:09 CET