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

Diff for /src/usr.bin/less/cmdbuf.c between version 1.15 and 1.16

version 1.15, 2016/03/16 15:36:26 version 1.16, 2016/09/17 15:06:41
Line 436 
Line 436 
         /*          /*
          * Make room for the new character (shift the tail of the buffer right).           * Make room for the new character (shift the tail of the buffer right).
          */           */
         for (s = &cmdbuf[strlen(cmdbuf)];  s >= cp;  s--)          for (s = &cmdbuf[strlen(cmdbuf)]; s >= cp; s--)
                 s[clen] = s[0];                  s[clen] = s[0];
         /*          /*
          * Insert the character into the buffer.           * Insert the character into the buffer.
          */           */
         for (s = cp;  s < cp + clen;  s++)          for (s = cp; s < cp + clen; s++)
                 *s = *cs++;                  *s = *cs++;
         /*          /*
          * Reprint the tail of the line from the inserted char.           * Reprint the tail of the line from the inserted char.
Line 883 
Line 883 
          * without a corresponding close quote), we return everything           * without a corresponding close quote), we return everything
          * from the open quote, including spaces.           * from the open quote, including spaces.
          */           */
         for (word = cmdbuf;  word < cp;  word++)          for (word = cmdbuf; word < cp; word++)
                 if (*word != ' ')                  if (*word != ' ')
                         break;                          break;
         if (word >= cp)          if (word >= cp)
                 return (cp);                  return (cp);
         for (p = cmdbuf;  p < cp;  p++) {          for (p = cmdbuf; p < cp; p++) {
                 if (meta_quoted) {                  if (meta_quoted) {
                         meta_quoted = 0;                          meta_quoted = 0;
                 } else if (esclen > 0 && p + esclen < cp &&                  } else if (esclen > 0 && p + esclen < cp &&
Line 1155 
Line 1155 
         off_t n = 0;          off_t n = 0;
         int err;          int err;
   
         for (p = cmdbuf;  *p >= '0' && *p <= '9';  p++)          for (p = cmdbuf; *p >= '0' && *p <= '9'; p++)
                 n = (n * 10) + (*p - '0');                  n = (n * 10) + (*p - '0');
         *frac = 0;          *frac = 0;
         if (*p++ == '.') {          if (*p++ == '.') {
Line 1239 
Line 1239 
                 return;                  return;
         }          }
         while (fgets(line, sizeof (line), f) != NULL) {          while (fgets(line, sizeof (line), f) != NULL) {
                 for (p = line;  *p != '\0';  p++) {                  for (p = line; *p != '\0'; p++) {
                         if (*p == '\n' || *p == '\r') {                          if (*p == '\n' || *p == '\r') {
                                 *p = '\0';                                  *p = '\0';
                                 break;                                  break;
Line 1274 
Line 1274 
                 histsize = 100;                  histsize = 100;
   
         ml = ml->prev;          ml = ml->prev;
         for (n = 0;  n < histsize;  n++) {          for (n = 0; n < histsize; n++) {
                 if (ml->string == NULL)                  if (ml->string == NULL)
                         break;                          break;
                 ml = ml->prev;                  ml = ml->prev;
         }          }
         for (ml = ml->next;  ml->string != NULL;  ml = ml->next)          for (ml = ml->next; ml->string != NULL; ml = ml->next)
                 (void) fprintf(f, "\"%s\n", ml->string);                  (void) fprintf(f, "\"%s\n", ml->string);
 }  }
   

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