[Pkg-lyx-devel] [SCM] LyX packaging branch, master, updated. upstream/2.0.0_rc3-549-g138209a

Sven Hoexter sven at timegate.de
Mon Apr 18 12:04:46 UTC 2011


The following commit has been merged in the master branch:
commit 617454e9395419237bf231aecb00cacfdaa22470
Author: Sven Hoexter <sven at timegate.de>
Date:   Mon Apr 18 13:45:06 2011 +0200

    Add debian/patches/path_max_hurd to fix another PATH_MAX problem in LyX. Patch provided by Pino Toscano. (Closes: #623164)

diff --git a/debian/changelog b/debian/changelog
index c7226b6..460b3a2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+lyx (2.0.0~rc3-2) unstable; urgency=low
+
+  * Add debian/patches/path_max_hurd to fix another PATH_MAX problem in LyX.
+    Patch provided by Pino Toscano. (Closes: #623164)
+
+ -- Sven Hoexter <hoexter at debian.org>  Mon, 18 Apr 2011 13:44:51 +0200
+
 lyx (2.0.0~rc3-1) unstable; urgency=low
 
   * New upstream release
diff --git a/debian/patches/path_max_hurd b/debian/patches/path_max_hurd
new file mode 100644
index 0000000..7438cd5
--- /dev/null
+++ b/debian/patches/path_max_hurd
@@ -0,0 +1,46 @@
+Try to fix another PATH_MAX issue with LyX on GNU/Hurd.
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=623164
+Patch provided by Pino Toscano <toscano.pino at tiscali.it>.
+--- a/src/support/filetools.cpp
++++ b/src/support/filetools.cpp
+@@ -49,6 +49,7 @@
+ #include <utility>
+ #include <fstream>
+ #include <sstream>
++#include <vector>
+ 
+ #if defined (_WIN32)
+ #include <io.h>
+@@ -759,13 +760,31 @@ docstring const makeDisplayPath(string c
+ #ifdef HAVE_READLINK
+ bool readLink(FileName const & file, FileName & link)
+ {
+-	char linkbuffer[PATH_MAX + 1];
+ 	string const encoded = file.toFilesystemEncoding();
++#ifdef HAVE_DEF_PATH_MAX
++	char linkbuffer[PATH_MAX + 1];
+ 	int const nRead = ::readlink(encoded.c_str(),
+ 				     linkbuffer, sizeof(linkbuffer) - 1);
+ 	if (nRead <= 0)
+ 		return false;
+ 	linkbuffer[nRead] = '\0'; // terminator
++#else
++	vector<char> buf(1024);
++	int nRead = -1;
++
++	while (true) {
++		nRead = ::readlink(encoded.c_str(), &buf[0], buf.size() - 1);
++		if (nRead < 0) {
++			return false;
++		}
++		if (nRead < buf.size() - 1) {
++			break;
++		}
++		buf.resize(buf.size() * 2);
++	}
++	buf[nRead] = '\0'; // terminator
++	const char * linkbuffer = &buf[0];
++#endif
+ 	link = makeAbsPath(linkbuffer, onlyPath(file.absFileName()));
+ 	return true;
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 3e16998..5d653a4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 prefer-xdg-open
+path_max_hurd

-- 
LyX packaging



More information about the Pkg-lyx-devel mailing list