pkgsrc-wip/help2man/patches/patch-hacklocaledir.c
Tilman Keskinöz b6a3ba22dc Import help2man,
------------
help2man is a tool for automatically generating simple manual pages from
program output.

It is intended to provide an easy way for software authors to include a
manual page in their distribution without having to maintain that document.

Given a program which produces resonably standard --help and --version
outputs, help2man will attempt to re-arrange that output into something
which resembles a manual page.
------------

Things that may not be correct:
patch-hacklocaledir.c was inspired by audio/arts/patches/patch-ab
REPLACE_PERL may be necessary.

Tested on:      NetBSD/i386 1.6.2
2004-05-10 15:13:13 +00:00

26 lines
729 B
C

$NetBSD: patch-hacklocaledir.c,v 1.1.1.1 2004/05/10 15:13:13 arved Exp $
--- hacklocaledir.c.orig Tue Jul 8 14:23:53 2003
+++ hacklocaledir.c Mon May 10 14:03:36 2004
@@ -40,12 +40,21 @@
static size_t matchlen;
char *newpath = 0;
int r;
-
+#ifdef RTLD_NEXT
if (!open && !(open = dlsym(RTLD_NEXT, "open")))
{
fprintf(stderr, PRELOAD ": can't find open(): %s\n", dlerror());
return -1;
}
+#else
+ void *handle = dlopen(NULL, DL_LAZY);
+ if (!open && !(open = dlsym(handle, "open")))
+ {
+ fprintf(stderr, PRELOAD ": can't find open(): %s\n", dlerror());
+ return -1;
+ }
+ dlclose(handle);
+#endif
if (textdomain || (textdomain = getenv("TEXTDOMAIN")))
{