summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-11-04 17:18:33 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-11-04 17:18:33 +0100
commit92af12daac8a33db8be0b33335bd79330ced9463 (patch)
tree32416d5ef4b5f96d09905d40c076a368fd275097 /config.h
parent903e929a85945567e9433b93f03567fe2f3b98fc (diff)
downloadvdr-92af12daac8a33db8be0b33335bd79330ced9463.tar.gz
vdr-92af12daac8a33db8be0b33335bd79330ced9463.tar.bz2
cReadLine now dynamically allocates its buffer; changed cConfig::Load() to use cReadLine instead of a fixed buffer
Diffstat (limited to 'config.h')
-rw-r--r--config.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/config.h b/config.h
index d7022901..ef84cf97 100644
--- a/config.h
+++ b/config.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: config.h 1.233 2005/11/04 14:18:59 kls Exp $
+ * $Id: config.h 1.234 2005/11/04 15:55:05 kls Exp $
*/
#ifndef __CONFIG_H
@@ -102,20 +102,21 @@ public:
isyslog("loading %s", fileName);
FILE *f = fopen(fileName, "r");
if (f) {
+ char *s;
int line = 0;
- char buffer[MAXPARSEBUFFER];
+ cReadLine ReadLine;
result = true;
- while (fgets(buffer, sizeof(buffer), f) > 0) {
+ while ((s = ReadLine.Read(f)) != NULL) {
line++;
if (allowComments) {
- char *p = strchr(buffer, '#');
+ char *p = strchr(s, '#');
if (p)
*p = 0;
}
- stripspace(buffer);
- if (!isempty(buffer)) {
+ stripspace(s);
+ if (!isempty(s)) {
T *l = new T;
- if (l->Parse(buffer))
+ if (l->Parse(s))
Add(l);
else {
esyslog("ERROR: error in %s, line %d", fileName, line);