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

Diff for /src/usr.bin/mg/yank.c between version 1.9 and 1.10

version 1.9, 2009/06/05 18:02:06 version 1.10, 2011/07/15 16:50:52
Line 169 
Line 169 
                                 chunk = 1;                                  chunk = 1;
                 }                  }
         } else if (n > 0) {          } else if (n > 0) {
                 chunk = llength(curwp->w_dotp) - curwp->w_doto + 1;                  chunk = llength(curwp->w_dotp) - curwp->w_doto;
                 nextp = lforw(curwp->w_dotp);                  nextp = lforw(curwp->w_dotp);
                   if (nextp != curbp->b_headp)
                           chunk++;                /* newline */
                   if (nextp == curbp->b_headp)
                           goto done;              /* EOL */
                 i = n;                  i = n;
                 while (--i) {                  while (--i) {
                         if (nextp == curbp->b_headp)                          chunk += llength(nextp);
                                 break;  
                         chunk += llength(nextp) + 1;  
                         nextp = lforw(nextp);                          nextp = lforw(nextp);
                           if (nextp != curbp->b_headp)
                                   chunk++;        /* newline */
                           if (nextp == curbp->b_headp)
                                   break;          /* EOL */
                 }                  }
         } else {          } else {
                 /* n <= 0 */                  /* n <= 0 */
Line 184 
Line 190 
                 curwp->w_doto = 0;                  curwp->w_doto = 0;
                 i = n;                  i = n;
                 while (i++) {                  while (i++) {
                         if (lback(curwp->w_dotp) == curbp->b_headp)                          if (lforw(curwp->w_dotp))
                                 break;                                  chunk++;
                         curwp->w_dotp = lback(curwp->w_dotp);                          curwp->w_dotp = lback(curwp->w_dotp);
                         curwp->w_rflag |= WFMOVE;                          curwp->w_rflag |= WFMOVE;
                         chunk += llength(curwp->w_dotp) + 1;                          chunk += llength(curwp->w_dotp);
                 }                  }
         }          }
         /*          /*
          * KFORW here is a bug.  Should be KBACK/KFORW, but we need to           * KFORW here is a bug.  Should be KBACK/KFORW, but we need to
          * rewrite the ldelete code (later)?           * rewrite the ldelete code (later)?
          */           */
         return (ldelete(chunk, KFORW));  done:
           if (chunk)
                   return (ldelete(chunk, KFORW));
           return (TRUE);
 }  }
   
 /*  /*

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