From 7a78fe63b0b28ef7231913dfefe9d08f9bc41c61 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Sat, 6 Nov 2021 21:07:03 +1100 Subject: [PATCH] Skip getline() on HP-UX 10.x. HP-UX 10.x has a getline() implementation in libc that does not behave as we expect so don't use it. With correction from Thorsten Glaser and typo fix from Larkin Nickle. --- configure.ac | 1 + openbsd-compat/bsd-getline.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 57fcc9bcd..165b391f7 100644 --- a/configure.ac +++ b/configure.ac @@ -765,6 +765,7 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16)) if test -z "$GCC"; then CFLAGS="$CFLAGS -Ae" fi + AC_DEFINE([BROKEN_GETLINE], [1], [getline is not what we expect]) ;; *-*-hpux11*) AC_DEFINE([PAM_SUN_CODEBASE], [1], diff --git a/openbsd-compat/bsd-getline.c b/openbsd-compat/bsd-getline.c index d676f4cef..e51bd7a13 100644 --- a/openbsd-compat/bsd-getline.c +++ b/openbsd-compat/bsd-getline.c @@ -39,7 +39,7 @@ #include "file.h" #endif -#if !HAVE_GETLINE +#if !defined(HAVE_GETLINE) || defined(BROKEN_GETLINE) #include #include #include