I think I found the fix. It was updating "rev1line" twice; once in the case where the current line number is less than the old line number, and once again where the current line number is less than the new line number. The latter -- the "new" side is the rev2 side.
The 1-line patch is attached. Nick Lewycky
--- diff.php.orig 2005-08-26 19:17:06.000000000 -0400 +++ diff.php 2005-08-26 19:16:08.000000000 -0400 @@ -167,7 +167,7 @@ else $line = rtrim($nl); - $listing[$index]["rev1line"] = hardspace($line); + $listing[$index]["rev2line"] = hardspace($line); $curnline++; } else