[patch] viewer lockup due to recent signed->unsigned change

Jindrich Makovicka makovick at kmlinux.fjfi.cvut.cz
Thu Aug 19 17:19:34 UTC 2004


Roland Illig wrote:
> I just discovered that the "two-lines-up" bug already existed in 
> mc-4.6.0. I'll nevertheless try to fix it. And I will commit the change 
> as suggested by Leonard, as it looks simpler and almost does the same.

Before you commit it, there is a similar bug in the hex viewer branch :)

@@ -1276,8 +1346,10 @@
  	return current;

      if (view->hex_mode) {
-	p = current - lines * view->bytes_per_line;
-	p = (p < view->first) ? view->first : p;
+	if (current < lines * view->bytes_per_line + view->first)
+	    p = view->first;
+	else
+	     p = current - lines * view->bytes_per_line;
  	if (lines == 1) {
  	    q = view->edit_cursor - view->bytes_per_line;
  	    view->edit_cursor = (q < view->first) ? view->edit_cursor : q;

-- 
Jindrich Makovicka



More information about the mc-devel mailing list