1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00
Files
guix/gnu/packages/patches/opensp-maxpathlen.patch
Yelninei 3afbbf8ae3 gnu: opensp: Fix build on the Hurd.
* gnu/packages/patches/opensp-maxpathlen.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/xml.scm (opensp): Add phase for adding the patch.

Change-Id: I47278396eb5ded8f654708019e51b7d88b13b976
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
2026-02-07 22:37:16 +01:00

42 lines
1.4 KiB
Diff

Adapted from https://sources.debian.org/src/opensp/1.5.2-15.2/debian/patches/diff-1.0.patch
Index: OpenSP-1.5.2/sx/XmlOutputEventHandler.cxx
===================================================================
--- OpenSP-1.5.2.orig/sx/XmlOutputEventHandler.cxx
+++ OpenSP-1.5.2/sx/XmlOutputEventHandler.cxx
@@ -1199,12 +1199,22 @@ void XmlOutputEventHandler::inputOpened(
// Check to make sure we haven't passed outside of the
// output directory
char *dirs = strdup (filePath);
+#ifdef MAXPATHLEN
char realDirs[MAXPATHLEN];
char realOutputDir[MAXPATHLEN];
+#else
+ char *realDirs;
+ char *realOutputDir;
+#endif
char *outputDir = strdup(outputDir_);
+#ifdef MAXPATHLEN
realpath((const char *)dirname(dirs), realDirs);
realpath((const char *)dirname(outputDir), realOutputDir);
+#else
+ realDirs = realpath((const char *)dirname(dirs), NULL);
+ realOutputDir = realpath((const char *)dirname(outputDir), NULL);
+#endif
if (strncmp(realDirs, realOutputDir, strlen (realOutputDir)) != 0) {
app_->message(XmlOutputMessages::pathOutsideOutputDirectory,
@@ -1214,6 +1224,11 @@ void XmlOutputEventHandler::inputOpened(
}
}
+#ifndef MAXPATHLEN
+ free(realDirs);
+ free(realOutputDir);
+#endif
+
// Make the necessary directories
maybeCreateDirectories(dirname(dirs));