aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/parser/scan.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-02-14 21:52:51 +0000
committermarha <marha@users.sourceforge.net>2010-02-14 21:52:51 +0000
commit00e6751183c1e854ea3eba746b101449b32201a4 (patch)
tree3494085d6728e086582f30c8a68846d81840303d /xorg-server/hw/xfree86/parser/scan.c
parentac637a8cd15f3977f44b701c7ac71a561763c1d8 (diff)
parent8d38172d866775594af3185ae3fbd8d750677650 (diff)
downloadvcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.tar.gz
vcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.tar.bz2
vcxsrv-00e6751183c1e854ea3eba746b101449b32201a4.zip
svn merge ^/branches/released
Diffstat (limited to 'xorg-server/hw/xfree86/parser/scan.c')
-rw-r--r--xorg-server/hw/xfree86/parser/scan.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/parser/scan.c b/xorg-server/hw/xfree86/parser/scan.c
index b80fbfb8f..03cbc8a44 100644
--- a/xorg-server/hw/xfree86/parser/scan.c
+++ b/xorg-server/hw/xfree86/parser/scan.c
@@ -227,13 +227,15 @@ xf86getNextLine(void)
configFiles[curFileIndex].file);
if (!ret) {
- /* stop if there are no more files */
- if (++curFileIndex >= numFiles) {
- curFileIndex = 0;
+ /*
+ * if the file doesn't end in a newline, add one
+ * and trigger another read
+ */
+ if (pos != 0) {
+ strcpy(&configBuf[pos], "\n");
+ ret = configBuf;
+ } else
break;
- }
- configLineNo = 0;
- continue;
}
/* search for EOL in the new block of chars */
@@ -338,7 +340,17 @@ again:
}
if (ret == NULL)
{
- return (pushToken = EOF_TOKEN);
+ /*
+ * if necessary, move to the next file and
+ * read the first line
+ */
+ if (curFileIndex + 1 < numFiles) {
+ curFileIndex++;
+ configLineNo = 0;
+ goto again;
+ }
+ else
+ return (pushToken = EOF_TOKEN);
}
configLineNo++;
configPos = 0;