From e51b2101f810bfe20a70a7e7d2069fcd07c8c9c4 Mon Sep 17 00:00:00 2001 From: Stephan Raue Date: Fri, 15 Jan 2010 21:27:13 +0100 Subject: [PATCH] xorg-server: - adding patch for problem with no new lines at the and of config files --- .../patches/xorg.conf-newlines.diff | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 packages/x11/xserver/xorg-server/patches/xorg.conf-newlines.diff diff --git a/packages/x11/xserver/xorg-server/patches/xorg.conf-newlines.diff b/packages/x11/xserver/xorg-server/patches/xorg.conf-newlines.diff new file mode 100644 index 0000000000..11b60aae61 --- /dev/null +++ b/packages/x11/xserver/xorg-server/patches/xorg.conf-newlines.diff @@ -0,0 +1,42 @@ +diff --git a/hw/xfree86/parser/scan.c b/hw/xfree86/parser/scan.c +index b80fbfb..8e37aef 100644 +--- a/hw/xfree86/parser/scan.c ++++ b/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,14 @@ again: + } + if (ret == NULL) + { +- return (pushToken = EOF_TOKEN); ++ /* move to the next file if necessary */ ++ if (curFileIndex + 1 < numFiles) { ++ curFileIndex++; ++ configLineNo = 0; ++ goto again; ++ } ++ else ++ return (pushToken = EOF_TOKEN); + } + configLineNo++; + configPos = 0;