]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Add missing definition for getline polyfill (#2425)
authorJulian Uy <uyjulian@gmail.com>
Fri, 6 Dec 2024 15:57:27 +0000 (09:57 -0600)
committerMartin Matuska <martin@matuska.de>
Tue, 11 Mar 2025 09:24:59 +0000 (10:24 +0100)
The fallback for when `getline` is not implemented in libc was not
compiling due to the fact that the definition for it was missing, so add
the definition.

(cherry picked from commit b5d95321d4b07dc381210fb26ac9d7533b8fc97b)

Makefile.am
unzip/CMakeLists.txt
unzip/bsdunzip.c
unzip/la_getline.h [new file with mode: 0644]

index 2217fc01946b6a43b520c08fa3cceaa103fd2db7..69d1cc6c54456620ced559d8aca526c558b1b1e4 100644 (file)
@@ -1496,6 +1496,7 @@ bsdunzip_SOURCES= \
                unzip/bsdunzip_platform.h \
                unzip/cmdline.c \
                unzip/la_getline.c \
+               unzip/la_getline.h \
                unzip/la_queue.h
 
 if INC_WINDOWS_FILES
index e9c346897b7134c01b409e799ff17f9c5553504b..d229507a3de8632434be513a3d43a33adeeb7963 100644 (file)
@@ -14,6 +14,7 @@ IF(ENABLE_UNZIP)
     bsdunzip_platform.h
     cmdline.c
     la_getline.c
+    la_getline.h
     la_queue.h
     ../libarchive_fe/err.c
     ../libarchive_fe/err.h
index 5058e8798753df315d22802ab3602a001ed7c962..18c130e90bd0fea71dc7fbd80174d4f487829557 100644 (file)
@@ -9,6 +9,7 @@
 #include "bsdunzip_platform.h"
 
 #include "la_queue.h"
+#include "la_getline.h"
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
diff --git a/unzip/la_getline.h b/unzip/la_getline.h
new file mode 100644 (file)
index 0000000..d758873
--- /dev/null
@@ -0,0 +1,16 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ */
+
+#ifndef LA_GETLINE_H_INCLUDED
+#define LA_GETLINE_H_INCLUDED
+
+#include <stdio.h>
+#ifndef HAVE_GETLINE
+ssize_t getline(char **buf, size_t *bufsiz, FILE *fp);
+#endif
+
+#endif /* !LA_GETLINE_H_INCLUDED */