[BACK]Return to position.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / less

Diff for /src/usr.bin/less/position.c between version 1.10 and 1.11

version 1.10, 2015/11/06 15:50:33 version 1.11, 2016/09/17 15:06:41
Line 63 
Line 63 
         /*          /*
          * Scroll the position table up.           * Scroll the position table up.
          */           */
         for (i = 1;  i < sc_height;  i++)          for (i = 1; i < sc_height; i++)
                 table[i-1] = table[i];                  table[i-1] = table[i];
         table[sc_height - 1] = pos;          table[sc_height - 1] = pos;
 }  }
Line 79 
Line 79 
         /*          /*
          * Scroll the position table down.           * Scroll the position table down.
          */           */
         for (i = sc_height - 1;  i > 0;  i--)          for (i = sc_height - 1; i > 0; i--)
                 table[i] = table[i-1];                  table[i] = table[i-1];
         table[0] = pos;          table[0] = pos;
 }  }
Line 92 
Line 92 
 {  {
         int i;          int i;
   
         for (i = 0;  i < sc_height;  i++)          for (i = 0; i < sc_height; i++)
                 table[i] = -1;                  table[i] = -1;
 }  }
   
Line 135 
Line 135 
   
         if (pos < table[0])          if (pos < table[0])
                 return (-1);                  return (-1);
         for (i = 1;  i < sc_height;  i++)          for (i = 1; i < sc_height; i++)
                 if (pos < table[i])                  if (pos < table[i])
                         return (i-1);                          return (i-1);
         return (-1);          return (-1);
Line 155 
Line 155 
 {  {
         int i;          int i;
   
         for (i = s;  i <= e;  i++)          for (i = s; i <= e; i++)
                 if (table[i] != -1 && table[i] != 0)                  if (table[i] != -1 && table[i] != 0)
                         return (0);                          return (0);
         return (1);          return (1);
Line 178 
Line 178 
          * Find the first line on the screen which has something on it,           * Find the first line on the screen which has something on it,
          * and return the screen line number and the file position.           * and return the screen line number and the file position.
          */           */
         for (i = 0; i < sc_height;  i++)          for (i = 0; i < sc_height; i++)
                 if (table[i] != -1) {                  if (table[i] != -1) {
                         scrpos->ln = i+1;                          scrpos->ln = i+1;
                         scrpos->pos = table[i];                          scrpos->pos = table[i];

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11