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

Diff for /src/usr.bin/less/linenum.c between version 1.14 and 1.15

version 1.14, 2016/01/12 17:48:04 version 1.15, 2016/09/17 15:06:41
Line 81 
Line 81 
          * Put all the entries on the free list.           * Put all the entries on the free list.
          * Leave one for the "spare".           * Leave one for the "spare".
          */           */
         for (p = pool;  p < &pool[NPOOL-2];  p++)          for (p = pool; p < &pool[NPOOL-2]; p++)
                 p->next = p+1;                  p->next = p+1;
         pool[NPOOL-2].next = NULL;          pool[NPOOL-2].next = NULL;
         freelist = pool;          freelist = pool;
Line 132 
Line 132 
          * Find the proper place in the list for the new one.           * Find the proper place in the list for the new one.
          * The entries are sorted by position.           * The entries are sorted by position.
          */           */
         for (p = anchor.next;  p != &anchor && p->pos < pos;  p = p->next)          for (p = anchor.next; p != &anchor && p->pos < pos; p = p->next)
                 if (p->line == linenum)                  if (p->line == linenum)
                         /* We already have this one. */                          /* We already have this one. */
                         return;                          return;
Line 185 
Line 185 
                  * not computed by calcgap.                   * not computed by calcgap.
                  */                   */
                 mingap = anchor.next->gap;                  mingap = anchor.next->gap;
                 for (p = anchor.next;  p->next != &anchor;  p = p->next) {                  for (p = anchor.next; p->next != &anchor; p = p->next) {
                         if (p->gap <= mingap) {                          if (p->gap <= mingap) {
                                 spare = p;                                  spare = p;
                                 mingap = p->gap;                                  mingap = p->gap;
Line 257 
Line 257 
         /*          /*
          * Find the entry nearest to the position we want.           * Find the entry nearest to the position we want.
          */           */
         for (p = anchor.next;  p != &anchor && p->pos < pos;  p = p->next)          for (p = anchor.next; p != &anchor && p->pos < pos; p = p->next)
                 continue;                  continue;
         if (p->pos == pos)          if (p->pos == pos)
                 /* Found it exactly. */                  /* Found it exactly. */
Line 355 
Line 355 
         /*          /*
          * Find the entry nearest to the line number we want.           * Find the entry nearest to the line number we want.
          */           */
         for (p = anchor.next;  p != &anchor && p->line < linenum;  p = p->next)          for (p = anchor.next; p != &anchor && p->line < linenum; p = p->next)
                 continue;                  continue;
         if (p->line == linenum)          if (p->line == linenum)
                 /* Found it exactly. */                  /* Found it exactly. */

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15