=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/file/Attic/apprentice.c,v retrieving revision 1.23 retrieving revision 1.24 diff -c -r1.23 -r1.24 *** src/usr.bin/file/Attic/apprentice.c 2006/10/31 18:06:27 1.23 --- src/usr.bin/file/Attic/apprentice.c 2007/10/05 14:29:46 1.24 *************** *** 1,4 **** ! /* $OpenBSD: apprentice.c,v 1.23 2006/10/31 18:06:27 ray Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; --- 1,4 ---- ! /* $OpenBSD: apprentice.c,v 1.24 2007/10/05 14:29:46 chl Exp $ */ /* * Copyright (c) Ian F. Darwin 1986-1995. * Software written by Ian F. Darwin and others; *************** *** 46,52 **** #endif #ifndef lint ! FILE_RCSID("@(#)$Id: apprentice.c,v 1.23 2006/10/31 18:06:27 ray Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ --- 46,52 ---- #endif #ifndef lint ! FILE_RCSID("@(#)$Id: apprentice.c,v 1.24 2007/10/05 14:29:46 chl Exp $") #endif /* lint */ #define EATAB {while (isascii((unsigned char) *l) && \ *************** *** 311,325 **** /* parse it */ for (lineno = 1; fgets(line, sizeof(line), f) != NULL; lineno++) { - char *p; - if (line[0]=='#') /* comment, do not parse */ continue; - if (strlen(line) <= (unsigned)1) /* null line, garbage, etc */ - continue; /* delete newline */ ! if ((p = strchr(line, '\n')) != NULL) ! *p = '\0'; if (parse(ms, magicp, nmagicp, line, action) != 0) errs = 1; } --- 311,322 ---- /* parse it */ for (lineno = 1; fgets(line, sizeof(line), f) != NULL; lineno++) { if (line[0]=='#') /* comment, do not parse */ continue; /* delete newline */ ! line[strcspn(line, "\n")] = '\0'; ! if (line[0] == '\0') ! continue; if (parse(ms, magicp, nmagicp, line, action) != 0) errs = 1; }