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

Diff for /src/usr.bin/rs/rs.c between version 1.28 and 1.29

version 1.28, 2015/11/10 14:42:41 version 1.29, 2015/11/14 17:03:02
Line 276 
Line 276 
         if (!(colwidths = calloc(ocols, sizeof(short))))          if (!(colwidths = calloc(ocols, sizeof(short))))
                 errx(1, "malloc:  No gutter space");                  errx(1, "malloc:  No gutter space");
         if (flags & SQUEEZE) {          if (flags & SQUEEZE) {
                 if (flags & TRANSPOSE)                  for (ep = elem, i = 0; i < ocols; i++) {
                         for (ep = elem, i = 0; i < ocols; i++) {                          max = 0;
                           if (flags & TRANSPOSE) {
                                 for (j = 0; j < orows; j++)                                  for (j = 0; j < orows; j++)
                                         if ((n = strlen(*ep++)) > max)                                          if ((n = strlen(*ep++)) > max)
                                                 max = n;                                                  max = n;
                                 colwidths[i] = max + gutter;                          } else {
                         }  
                 else  
                         for (ep = elem, i = 0; i < ocols; i++) {  
                                 for (j = i; j < nelem; j += ocols)                                  for (j = i; j < nelem; j += ocols)
                                         if ((n = strlen(ep[j])) > max)                                          if ((n = strlen(ep[j])) > max)
                                                 max = n;                                                  max = n;
                                 colwidths[i] = max + gutter;  
                         }                          }
                           colwidths[i] = max + gutter;
                   }
         } else {          } else {
                 for (i = 0; i < ocols; i++)                  for (i = 0; i < ocols; i++)
                         colwidths[i] = colw;                          colwidths[i] = colw;

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29