]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix patch for FTBFS on hurd. Thanks to Petter Reinholdtsen for the bug report and...
authorDr. Tobias Quathamer <toddy@debian.org>
Mon, 18 Jul 2016 16:10:51 +0000 (18:10 +0200)
committerAnthony Fok <foka@debian.org>
Fri, 27 Jan 2017 12:00:33 +0000 (05:00 -0700)
debian/patches/hurd_file_name_support

index bb5122ebafdcba8b2243dbba8c085727503de014..4caf1e62b062f114b1e3212bb4e51e0f08cb588b 100644 (file)
@@ -1,15 +1,23 @@
 Description: Hurd build without PATH_MAX; currently broken
-Forwarded: not-needed
-Origin: vendor
+Forwarded: http://lists.gnu.org/archive/html/bug-lilypond/2017-01/msg00023.html
+Origin: vendor, https://bugs.debian.org/cgi-bin/bugreport.cgi?att=1;bug=761036;filename=hurd_file_name_support;msg=5
+Bug-Debian: https://bugs.debian.org/761036
 Author: Don Armstrong <don@debian.org>
---- lilypond-2.18.0.orig/flower/file-name.cc
-+++ lilypond-2.18.0/flower/file-name.cc
-@@ -96,9 +96,13 @@
+Author: Petter Reinholdtsen <pere@hungry.com>
+Reviewed-by: Dr. Tobias Quathamer <toddy@debian.org>
+Reviewed-by: Anthony Fok <foka@debian.org>
+Last-Update: 2017-01-27
+--- a/flower/file-name.cc
++++ b/flower/file-name.cc
+@@ -96,9 +96,16 @@
  string
  get_working_directory ()
  {
-+#ifdef _GNU_SOURCE_
-+  return string (get_current_dir_name());
++#ifdef _GNU_SOURCE
++  char *cwd = get_current_dir_name();
++  string scwd(cwd);
++  free(cwd);
++  return scwd;
 +#else
    char cwd[PATH_MAX];
    // getcwd returns NULL upon a failure, contents of cwd would be undefined!
@@ -18,3 +26,34 @@ Author: Don Armstrong <don@debian.org>
  }
  
  /* Join components to full file_name. */
+--- a/flower/test-file-path.cc
++++ b/flower/test-file-path.cc
+@@ -6,12 +6,26 @@
+ #include "yaffut.hh"
+ #include "config.hh"
++string
++get_working_directory ()
++{
++#ifdef _GNU_SOURCE
++  char *cwd = get_current_dir_name();
++  string scwd(cwd);
++  free(cwd);
++  return scwd;
++#else
++  char cwd[PATH_MAX];
++  // getcwd returns NULL upon a failure, contents of cwd would be undefined!
++  return string (getcwd (cwd, PATH_MAX));
++#endif
++}
++
+ TEST (File_path, Find)
+ {
+   char const *extensions[] = {"ly", "", 0};
+   string file = "init";
+-  char cwd[PATH_MAX];
+-  if (!getcwd (cwd, PATH_MAX))
++  if (get_working_directory().empty())
+     {
+       cerr << "Could not get current work directory\n";
+       exit (1);