From 0a0bf0b040ea92afa15a01004094f2e480abd869 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 5 Feb 2019 00:43:55 +0000 Subject: Inline lower into name_to_key With only one remaining user, it wasn't pulling its weight. * libdb/db_lookup.c (name_to_key): Inline the implementation of lower. * lib/Makefile.am (libman_la_SOURCES): Remove lower.c and lower.h. * lib/README: Remove lower.*. * lib/lower.c, lib/lower.h: Remove. --- libdb/db_lookup.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libdb') diff --git a/libdb/db_lookup.c b/libdb/db_lookup.c index ff5e2310..28cd90e2 100644 --- a/libdb/db_lookup.c +++ b/libdb/db_lookup.c @@ -47,7 +47,6 @@ #include "manconfig.h" #include "glcontainers.h" -#include "lower.h" #include "wordfnmatch.h" #include "xregcomp.h" @@ -162,7 +161,13 @@ void free_mandata_struct (struct mandata *pinfo) */ char *name_to_key (const char *name) { - return lower (name); + char *low, *p; + + p = low = xmalloc (strlen (name) + 1); + while (*name) + *p++ = CTYPE (tolower, *name++); + *p = *name; + return low; } /* return char ptr array to the data's fields */ -- cgit v1.2.3