[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.10 and 1.11

version 1.10, 2004/12/01 16:41:07 version 1.11, 2004/12/02 22:54:55
Line 171 
Line 171 
                                     linenum);                                      linenum);
                                 continue;                                  continue;
                         }                          }
   
                         lineptr[strlen(lineptr) - 1] = 0;                          lineptr[strlen(lineptr) - 1] = 0;
                           for (i = 0; i < prefixcount; i++) {
                                   if (!strcmp(prefixtable[i].prefixname, lineptr))
                                           break;
                           }
                           if (i < prefixcount) {
                                   fprintf(stderr, "Redefinition of prefix '%s' "
                                       "on line %d ignored\n", lineptr, linenum);
                                   continue;       /* skip duplicate prefix */
                           }
   
                         prefixtable[prefixcount].prefixname = dupstr(lineptr);                          prefixtable[prefixcount].prefixname = dupstr(lineptr);
                         for (i = 0; i < prefixcount; i++)  
                                 if (!strcmp(prefixtable[i].prefixname, lineptr)) {  
                                         fprintf(stderr,  
                                             "Redefinition of prefix '%s' on line %d ignored\n",  
                                             lineptr, linenum);  
                                         continue;  
                                 }  
                         lineptr += len + 1;                          lineptr += len + 1;
                         if (!strlen(lineptr)) {                          if (!strlen(lineptr)) {
                                 readerror(linenum);                                  readerror(linenum);
Line 197 
Line 201 
                                     linenum);                                      linenum);
                                 continue;                                  continue;
                         }                          }
   
                           for (i = 0; i < unitcount; i++) {
                                   if (!strcmp(unittable[i].uname, lineptr))
                                           break;
                           }
                           if (i < unitcount) {
                                   fprintf(stderr, "Redefinition of unit '%s' "
                                       "on line %d ignored\n", lineptr, linenum);
                                   continue;       /* skip duplicate unit */
                           }
   
                         unittable[unitcount].uname = dupstr(lineptr);                          unittable[unitcount].uname = dupstr(lineptr);
                         for (i = 0; i < unitcount; i++)  
                                 if (!strcmp(unittable[i].uname, lineptr)) {  
                                         fprintf(stderr,  
                                             "Redefinition of unit '%s' on line %d ignored\n",  
                                             lineptr, linenum);  
                                         continue;  
                                 }  
                         lineptr += len + 1;                          lineptr += len + 1;
                         lineptr += strspn(lineptr, " \n\t");                          lineptr += strspn(lineptr, " \n\t");
                         if (!strlen(lineptr)) {                          if (!strlen(lineptr)) {

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