[dahdi-commits] tzafrir: tools/trunk r7333 - /tools/trunk/xpp/astribank_allow.c
SVN commits to the DAHDI project
dahdi-commits at lists.digium.com
Sun Oct 4 08:25:29 CDT 2009
Author: tzafrir
Date: Sun Oct 4 08:25:18 2009
New Revision: 7333
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7333
Log:
xpp: ignore everything after the end of the license stanza
Modified:
tools/trunk/xpp/astribank_allow.c
Modified: tools/trunk/xpp/astribank_allow.c
URL: http://svnview.digium.com/svn/dahdi/tools/trunk/xpp/astribank_allow.c?view=diff&rev=7333&r1=7332&r2=7333
==============================================================================
--- tools/trunk/xpp/astribank_allow.c (original)
+++ tools/trunk/xpp/astribank_allow.c Sun Oct 4 08:25:18 2009
@@ -199,7 +199,7 @@
* 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 @@
}
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 @@
}
break;
case 4:
- ERR("Extra data after license end block\n");
- return -1;
+ break;
+
}
}
if (state != 4) {
More information about the dahdi-commits
mailing list