From 8d38172d866775594af3185ae3fbd8d750677650 Mon Sep 17 00:00:00 2001 From: marha Date: Sun, 14 Feb 2010 13:47:55 +0000 Subject: Updated to xorg-server-1.7.99.901 --- xorg-server/hw/xfree86/parser/scan.c | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'xorg-server/hw/xfree86/parser/scan.c') 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; -- cgit v1.2.3