[Asterisk-cvs] asterisk/pbx pbx_spool.c,1.20,1.21
kpfleming at lists.digium.com
kpfleming at lists.digium.com
Fri Apr 1 15:37:51 CST 2005
Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv2299/pbx
Modified Files:
pbx_spool.c
Log Message:
optimize file reading in pbx_spool (bug #3927)
Index: pbx_spool.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_spool.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- pbx_spool.c 1 Apr 2005 03:41:08 -0000 1.20
+++ pbx_spool.c 1 Apr 2005 21:31:12 -0000 1.21
@@ -94,10 +94,8 @@
char buf[256];
char *c, *c2;
int lineno = 0;
- while(!feof(f)) {
- fgets(buf, sizeof(buf), f);
+ while(fgets(buf, sizeof(buf), f)) {
lineno++;
- if (!ast_strlen_zero(buf)) {
/* Trim comments */
c = buf;
while ((c = strchr(c, '#'))) {
@@ -186,7 +184,6 @@
} else
ast_log(LOG_NOTICE, "Syntax error at line %d of %s\n", lineno, fn);
}
- }
}
strncpy(o->fn, fn, sizeof(o->fn) - 1);
if (ast_strlen_zero(o->tech) || ast_strlen_zero(o->dest) || (ast_strlen_zero(o->app) && ast_strlen_zero(o->exten))) {
More information about the svn-commits
mailing list