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

Diff for /src/usr.bin/units/units.c between version 1.9 and 1.10

version 1.9, 2003/07/02 01:57:15 version 1.10, 2004/12/01 16:41:07
Line 183 
Line 183 
                         lineptr += len + 1;                          lineptr += len + 1;
                         if (!strlen(lineptr)) {                          if (!strlen(lineptr)) {
                                 readerror(linenum);                                  readerror(linenum);
                                   free(prefixtable[prefixcount].prefixname);
                                 continue;                                  continue;
                         }                          }
                         lineptr += strspn(lineptr, " \n\t");                          lineptr += strspn(lineptr, " \n\t");
Line 208 
Line 209 
                         lineptr += strspn(lineptr, " \n\t");                          lineptr += strspn(lineptr, " \n\t");
                         if (!strlen(lineptr)) {                          if (!strlen(lineptr)) {
                                 readerror(linenum);                                  readerror(linenum);
                                   free(unittable[unitcount].uname);
                                 continue;                                  continue;
                         }                          }
                         len = strcspn(lineptr, "\n\t");                          len = strcspn(lineptr, "\n\t");
Line 332 
Line 334 
                                         num = atof(item);                                          num = atof(item);
                                         if (!num) {                                          if (!num) {
                                                 zeroerror();                                                  zeroerror();
                                                   free(savescr);
                                                 return 1;                                                  return 1;
                                         }                                          }
                                         if (doingtop ^ flip)                                          if (doingtop ^ flip)
Line 341 
Line 344 
                                         num = atof(divider + 1);                                          num = atof(divider + 1);
                                         if (!num) {                                          if (!num) {
                                                 zeroerror();                                                  zeroerror();
                                                   free(savescr);
                                                 return 1;                                                  return 1;
                                         }                                          }
                                         if (doingtop ^ flip)                                          if (doingtop ^ flip)
Line 351 
Line 355 
                                         num = atof(item);                                          num = atof(item);
                                         if (!num) {                                          if (!num) {
                                                 zeroerror();                                                  zeroerror();
                                                   free(savescr);
                                                 return 1;                                                  return 1;
                                         }                                          }
                                         if (doingtop ^ flip)                                          if (doingtop ^ flip)
Line 368 
Line 373 
                                         item[strlen(item) - 1] = 0;                                          item[strlen(item) - 1] = 0;
                                 }                                  }
                                 for (; repeat; repeat--)                                  for (; repeat; repeat--)
                                         if (addsubunit(doingtop ^ flip ? theunit->numerator : theunit->denominator, item))                                          if (addsubunit(doingtop ^ flip
                                               ? theunit->numerator
                                               : theunit->denominator, item)) {
                                                   free(savescr);
                                                 return 1;                                                  return 1;
                                           }
                         }                          }
                         item = strtok(NULL, " *\t/\n");                          item = strtok(NULL, " *\t/\n");
                 }                  }

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10