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

Diff for /src/usr.bin/file/Attic/apprentice.c between version 1.22 and 1.23

version 1.22, 2006/04/04 14:17:01 version 1.23, 2006/10/31 18:06:27
Line 311 
Line 311 
   
         /* parse it */          /* parse it */
         for (lineno = 1; fgets(line, sizeof(line), f) != NULL; lineno++) {          for (lineno = 1; fgets(line, sizeof(line), f) != NULL; lineno++) {
                   char *p;
   
                 if (line[0]=='#')       /* comment, do not parse */                  if (line[0]=='#')       /* comment, do not parse */
                         continue;                          continue;
                 if (strlen(line) <= (unsigned)1) /* null line, garbage, etc */                  if (strlen(line) <= (unsigned)1) /* null line, garbage, etc */
                         continue;                          continue;
                 line[strlen(line)-1] = '\0'; /* delete newline */                  /* delete newline */
                   if ((p = strchr(line, '\n')) != NULL)
                           *p = '\0';
                 if (parse(ms, magicp, nmagicp, line, action) != 0)                  if (parse(ms, magicp, nmagicp, line, action) != 0)
                         errs = 1;                          errs = 1;
         }          }

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23