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

Diff for /src/usr.bin/mg/echo.c between version 1.42 and 1.43

version 1.42, 2005/12/13 06:01:27 version 1.43, 2005/12/20 06:17:36
Line 99 
Line 99 
   
                                 maclcur = lp->l_bp;                                  maclcur = lp->l_bp;
                                 maclcur->l_fp = lp->l_fp;                                  maclcur->l_fp = lp->l_fp;
                                 free((char *)lp);                                  free(lp);
                         }                          }
 #endif /* !NO_MACRO */  #endif /* !NO_MACRO */
                         if ((rep[0] == 'y' || rep[0] == 'Y') &&                          if ((rep[0] == 'y' || rep[0] == 'Y') &&
Line 594 
Line 594 
         int      oldhue = tthue;          int      oldhue = tthue;
         char     *linebuf;          char     *linebuf;
         size_t   linesize, len;          size_t   linesize, len;
         const char *cp;          char *cp;
   
         lh = NULL;          lh = NULL;
   
Line 700 
Line 700 
                                 linebuf[0] = '\0';                                  linebuf[0] = '\0';
                                 width = 0;                                  width = 0;
                         }                          }
                         len = strlcat(linebuf, lh2->l_name + preflen, linesize);                          len = strlcat(linebuf, lh2->l_name + preflen,
                               linesize);
                         width += maxwidth;                          width += maxwidth;
                         if (len < width && width < linesize) {                          if (len < width && width < linesize) {
                                 /* pad so the objects nicely line up */                                  /* pad so the objects nicely line up */
Line 923 
Line 924 
   
         while (lp) {          while (lp) {
                 next = lp->l_next;                  next = lp->l_next;
                   free(lp->l_name);
                 free(lp);                  free(lp);
                 lp = next;                  lp = next;
         }          }
Line 937 
Line 939 
         while (lp) {          while (lp) {
                 current = (struct list *)malloc(sizeof(struct list));                  current = (struct list *)malloc(sizeof(struct list));
                 if (current == NULL) {                  if (current == NULL) {
                           /* Free what we have allocated so far */
                         for (current = last; current; current = nxt) {                          for (current = last; current; current = nxt) {
                                 nxt = current->l_next;                                  nxt = current->l_next;
                                   free(current->l_name);
                                 free(current);                                  free(current);
                         }                          }
                         return (NULL);                          return (NULL);
                 }                  }
                 current->l_next = last;                  current->l_next = last;
                 current->l_name = lp->l_name;                  current->l_name = strdup(lp->l_name);
                 last = current;                  last = current;
                 lp = lp->l_next;                  lp = lp->l_next;
         }          }

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43