Don't try to use PATH_MAX in the Hurd
authorAlberto Garcia <berto@igalia.com>
Tue, 21 Sep 2021 16:16:51 +0000 (17:16 +0100)
committerRaspbian forward porter <root@raspbian.org>
Tue, 21 Sep 2021 16:16:51 +0000 (17:16 +0100)
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=978098
Bug: https://bugs.webkit.org/show_bug.cgi?id=219572

===================================================================

Gbp-Pq: Name fix-ftbfs-hurd.patch

Source/WebCore/platform/text/hyphen/HyphenationLibHyphen.cpp

index 7f73301da003107e939dfb86b3689354c9d94350..fa7fd311d6309ec34d8511cd5ace3a2ca9d805d3 100644 (file)
@@ -67,11 +67,21 @@ static void scanDirectoryForDictionaries(const char* directoryPath, HashMap<Atom
     for (auto& filePath : FileSystem::listDirectory(directoryPath, "hyph_*.dic")) {
         String locale = extractLocaleFromDictionaryFilePath(filePath).convertToASCIILowercase();
 
+#if OS(HURD)
+        char *normalizedPath;
+        normalizedPath = realpath(FileSystem::fileSystemRepresentation(filePath).data(), NULL);
+        if (!normalizedPath)
+            continue;
+
+        filePath = FileSystem::stringFromFileSystemRepresentation(normalizedPath);
+        free(normalizedPath);
+#else
         char normalizedPath[PATH_MAX];
         if (!realpath(FileSystem::fileSystemRepresentation(filePath).data(), normalizedPath))
             continue;
 
         filePath = FileSystem::stringFromFileSystemRepresentation(normalizedPath);
+#endif
         availableLocales.add(locale, Vector<String>()).iterator->value.append(filePath);
 
         String localeReplacingUnderscores = String(locale);