Conditionalize a few more functions (hopefully fixing the build)

This commit is contained in:
martin 2020-04-05 14:53:39 +00:00
parent 841fdb7e60
commit b6924e8af2
2 changed files with 12 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: term.c,v 1.33 2020/04/05 12:31:02 roy Exp $ */
/* $NetBSD: term.c,v 1.34 2020/04/05 14:53:39 martin Exp $ */
/*
* Copyright (c) 2009, 2010, 2011, 2020 The NetBSD Foundation, Inc.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: term.c,v 1.33 2020/04/05 12:31:02 roy Exp $");
__RCSID("$NetBSD: term.c,v 1.34 2020/04/05 14:53:39 martin Exp $");
#include <sys/stat.h>
@ -349,6 +349,11 @@ _ti_dbgettermp(TERMINAL *term, const char *path, const char *name, int flags)
static int
_ti_findterm(TERMINAL *term, const char *name, int flags)
{
#ifndef TERMINFO_DB
_ti_database = NULL;
return 0;
#else
int r;
char *c, *e;
@ -359,10 +364,8 @@ _ti_findterm(TERMINAL *term, const char *name, int flags)
r = 0;
e = getenv("TERMINFO");
#ifdef TERMINFO_DB
if (e != NULL && *e == '/')
return _ti_dbgetterm(term, e, name, flags);
#endif
c = NULL;
#ifdef TERMINFO_COMPILE
@ -410,9 +413,7 @@ _ti_findterm(TERMINAL *term, const char *name, int flags)
return r;
}
}
#endif
#ifdef TERMINFO_DB
if ((e = getenv("TERMINFO_DIRS")) != NULL)
return _ti_dbgettermp(term, e, name, flags);
@ -427,6 +428,7 @@ _ti_findterm(TERMINAL *term, const char *name, int flags)
#endif
return r;
#endif
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: termcap.c,v 1.23 2020/03/27 17:39:53 christos Exp $ */
/* $NetBSD: termcap.c,v 1.24 2020/04/05 14:53:39 martin Exp $ */
/*
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__RCSID("$NetBSD: termcap.c,v 1.23 2020/03/27 17:39:53 christos Exp $");
__RCSID("$NetBSD: termcap.c,v 1.24 2020/04/05 14:53:39 martin Exp $");
#include <assert.h>
#include <ctype.h>
@ -183,6 +183,7 @@ tgoto(const char *cm, int destcol, int destline)
return tiparm(cm, destline, destcol);
}
#ifdef TERMINFO_COMPILE
static const char *
flagname(const char *key)
{
@ -600,4 +601,4 @@ captoinfo(char *cap)
*ip = '\0';
return info;
}
#endif