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

Diff for /src/usr.bin/m4/gnum4.c between version 1.34 and 1.35

version 1.34, 2006/03/23 07:57:33 version 1.35, 2006/03/23 08:04:54
Line 507 
Line 507 
 {  {
         const char *format = argv[2];          const char *format = argv[2];
         int pos = 3;          int pos = 3;
   
         while (*format != 0) {          while (*format != 0) {
                 if (*format != '%') {                  if (*format != '%') {
                         addchar(*format++);                          addchar(*format++);
Line 522 
Line 523 
                             size_t l;                              size_t l;
   
                             if (*format == '-') {                              if (*format == '-') {
                                 left_padded = 1;                                      left_padded = 1;
                                 format++;                                      format++;
                             }                              }
                             width = strtoul(format, (char **)&format, 10);                              width = strtoul(format, (char **)&format, 10);
                             if (*format != 's') {                              if (*format != 's') {
                                 m4errx(1, "Unsupported format specification: %s.", argv[2]);                                      m4errx(1, "Unsupported format specification: %s.", argv[2]);
                             }                              }
                             format++;                              format++;
                             if (pos >= argc)                              if (pos >= argc)
                                 m4errx(1, "Format with too many values.");                                      m4errx(1, "Format with too many values.");
                             l = strlen(argv[pos]);                              l = strlen(argv[pos]);
                             if (!left_padded) {                              if (!left_padded) {
                                     while (l < width--)                                      while (l < width--)
Line 539 
Line 540 
                             }                              }
                             addchars(argv[pos++], l);                              addchars(argv[pos++], l);
                             if (left_padded) {                              if (left_padded) {
                                 while (l < width--)                                      while (l < width--)
                                         addchar(' ');                                              addchar(' ');
                             }                              }
                         }                          }
                 }                  }

Legend:
Removed from v.1.34  
changed lines
  Added in v.1.35