diff options
author | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-01-12 19:05:40 +0000 |
---|---|---|
committer | Tzafrir Cohen <tzafrir.cohen@xorcom.com> | 2010-01-12 19:05:40 +0000 |
commit | 8305dfd6df004acde8d6581fa1d6151bb8d408e1 (patch) | |
tree | c70f95f98821efe679d13370af647aa5a8f429d0 | |
parent | f0bc6d705f4f9381d3d13b889a98efe906aeddfe (diff) |
xpp: ignore everything after the end of the license stanza
Merged revisions 7333 via svnmerge from
http://svn.digium.com/svn/dahdi/tools/trunk
git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/branches/2.2@7901 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r-- | xpp/astribank_allow.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/xpp/astribank_allow.c b/xpp/astribank_allow.c index ec60d4a..b68c3a2 100644 --- a/xpp/astribank_allow.c +++ b/xpp/astribank_allow.c @@ -199,7 +199,7 @@ static int read_from_file(struct eeprom_table *eeprom_table, struct capabilities * 1: read Version, goto 2. if not version line then error. * 2: after BEGIN line. split line into key:value. if line is Data:, goto 3. * 3: read binary data. if line is END_LICENSE_BLOCK goto 4. - * 4: END_LICENSE_BLOCK - if not EOF - error. otherwise exit loop and success. + * 4: END_LICENSE_BLOCK - ignore lines. */ while (fgets(buf, 256, f) != NULL) { lineno++; @@ -210,7 +210,12 @@ static int read_from_file(struct eeprom_table *eeprom_table, struct capabilities } line = trim(buf); if (line == NULL) { - ERR("Line %d: Empty line\n", lineno); + if (state > 0 && state < 4) { + ERR("Line %d: Empty line\n", lineno); + return -1; + } + else + continue; } switch (state) { case 0: @@ -259,8 +264,8 @@ static int read_from_file(struct eeprom_table *eeprom_table, struct capabilities } break; case 4: - ERR("Extra data after license end block\n"); - return -1; + break; + } } if (state != 4) { |