=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/position.c,v retrieving revision 1.10 retrieving revision 1.11 diff -c -r1.10 -r1.11 *** src/usr.bin/less/position.c 2015/11/06 15:50:33 1.10 --- src/usr.bin/less/position.c 2016/09/17 15:06:41 1.11 *************** *** 63,69 **** /* * Scroll the position table up. */ ! for (i = 1; i < sc_height; i++) table[i-1] = table[i]; table[sc_height - 1] = pos; } --- 63,69 ---- /* * Scroll the position table up. */ ! for (i = 1; i < sc_height; i++) table[i-1] = table[i]; table[sc_height - 1] = pos; } *************** *** 79,85 **** /* * Scroll the position table down. */ ! for (i = sc_height - 1; i > 0; i--) table[i] = table[i-1]; table[0] = pos; } --- 79,85 ---- /* * Scroll the position table down. */ ! for (i = sc_height - 1; i > 0; i--) table[i] = table[i-1]; table[0] = pos; } *************** *** 92,98 **** { int i; ! for (i = 0; i < sc_height; i++) table[i] = -1; } --- 92,98 ---- { int i; ! for (i = 0; i < sc_height; i++) table[i] = -1; } *************** *** 135,141 **** if (pos < table[0]) return (-1); ! for (i = 1; i < sc_height; i++) if (pos < table[i]) return (i-1); return (-1); --- 135,141 ---- if (pos < table[0]) return (-1); ! for (i = 1; i < sc_height; i++) if (pos < table[i]) return (i-1); return (-1); *************** *** 155,161 **** { int i; ! for (i = s; i <= e; i++) if (table[i] != -1 && table[i] != 0) return (0); return (1); --- 155,161 ---- { int i; ! for (i = s; i <= e; i++) if (table[i] != -1 && table[i] != 0) return (0); return (1); *************** *** 178,184 **** * Find the first line on the screen which has something on it, * and return the screen line number and the file position. */ ! for (i = 0; i < sc_height; i++) if (table[i] != -1) { scrpos->ln = i+1; scrpos->pos = table[i]; --- 178,184 ---- * Find the first line on the screen which has something on it, * and return the screen line number and the file position. */ ! for (i = 0; i < sc_height; i++) if (table[i] != -1) { scrpos->ln = i+1; scrpos->pos = table[i];