[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.12 and 1.13

version 1.12, 2005/05/14 17:01:41 version 1.13, 2005/05/14 17:12:51
Line 303 
Line 303 
                                                 max = n;                                                  max = n;
                                 colwidths[i] = max + gutter;                                  colwidths[i] = max + gutter;
                         }                          }
         }          } else {
         /*      for (i = 0; i < orows; i++) {  
                         for (j = i; j < nelem; j += orows)  
                                 prints(ep[j], (j - i) / orows);  
                         putchar('\n');  
                 }  
         else  
                 for (i = 0; i < orows; i++) {  
                         for (j = 0; j < ocols; j++)  
                                 prints(*ep++, j);  
                         putchar('\n');  
                 }*/  
         else  
                 for (i = 0; i < ocols; i++)                  for (i = 0; i < ocols; i++)
                         colwidths[i] = colw;                          colwidths[i] = colw;
           }
         if (!(flags & NOTRIMENDCOL)) {          if (!(flags & NOTRIMENDCOL)) {
                 if (flags & RIGHTADJUST)                  if (flags & RIGHTADJUST)
                         colwidths[0] -= gutter;                          colwidths[0] -= gutter;
Line 327 
Line 316 
         n = orows * ocols;          n = orows * ocols;
         if (n > nelem && (flags & RECYCLE))          if (n > nelem && (flags & RECYCLE))
                 nelem = n;                  nelem = n;
         /*for (i = 0; i < ocols; i++)  
                 fprintf(stderr, "%d ",colwidths[i]);  
         fprintf(stderr, "is colwidths, nelem %d\n", nelem);*/  
 }  }
   
 #define BSIZE   2048  #define BSIZE   2048
Line 353 
Line 339 
                         printf(" %d line %d\n", curlen, irows);                          printf(" %d line %d\n", curlen, irows);
         }          }
         if (!putlength && endblock - curline < BUFSIZ) {   /* need storage */          if (!putlength && endblock - curline < BUFSIZ) {   /* need storage */
                 /*ww = endblock-curline; tt += ww;*/  
                 /*printf("#wasted %d total %d\n",ww,tt);*/  
                 if (!(curline = (char *) malloc(BSIZE)))                  if (!(curline = (char *) malloc(BSIZE)))
                         errx(1, "File too large");                          errx(1, "File too large");
                 endblock = curline + BSIZE;                  endblock = curline + BSIZE;
                 /*printf("#endb %d curline %d\n",endblock,curline);*/  
         }          }
         for (p = curline, i = 1; i < BUFSIZ; *p++ = c, i++)          for (p = curline, i = 1; i < BUFSIZ; *p++ = c, i++)
                 if ((c = getchar()) == EOF || c == '\n')                  if ((c = getchar()) == EOF || c == '\n')
Line 472 
Line 455 
                 case 'z':                       /* squeeze col width */                  case 'z':                       /* squeeze col width */
                         flags |= SQUEEZE;                          flags |= SQUEEZE;
                         break;                          break;
                 /*case 'p':  
                         ipagespace = atoi(++p); (default is 1)  
                         break;*/  
                 case 'o':                       /* col order */                  case 'o':                       /* col order */
                         getlist(&cord, optarg);                          getlist(&cord, optarg);
                         break;                          break;
Line 493 
Line 473 
         ac -= optind;          ac -= optind;
         av += optind;          av += optind;
   
         /*if (!osep)  
                 osep = isep;*/  
         switch (ac) {          switch (ac) {
         /*case 3:  
                 opages = atoi(av[2]);*/  
         case 2:          case 2:
                 ocols = atoi(av[1]);                  ocols = atoi(av[1]);
         case 1:          case 1:

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13