]> 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)
committerGitHub <noreply@github.com>
Fri, 6 Dec 2024 15:57:27 +0000 (07:57 -0800)
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.

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

index 46a3c0e7f0d84f1183c1090df6aa8002d2c339bc..96f6aeaed7e7a3c59b54f70e531c307ea8e9ac4d 100644 (file)
@@ -1499,6 +1499,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 */