build: Fix build and behaviour on OpenBSD.

Summary:
OpenBSD does not have strchrnul. Also, fix range
issue with window size.

The geometry is broken on OpenBSD and DragonFlyBSD.
A previous patch solved this issue. Range was
changed to <= 0, but needs to be <= 1 to  ensure
the terminal opens and displays content.

Reviewers: billiob

Reviewed By: billiob

Differential Revision: https://phab.enlightenment.org/D9157
This commit is contained in:
Alastair Poole 2019-06-23 16:39:17 +02:00 committed by Boris Faure
parent 253446db49
commit 18bff78895
2 changed files with 18 additions and 1 deletions

View File

@ -3010,7 +3010,7 @@ _smart_size(Evas_Object *obj, int w, int h, Eina_Bool force)
EINA_SAFETY_ON_NULL_RETURN(sd);
if ((w <= 0) || (h <= 0))
if ((w <= 1) || (h <= 1))
{
w = 80;
h = 24;

View File

@ -3409,6 +3409,23 @@ _eina_unicode_to_hex(Eina_Unicode u)
return -1;
}
#if defined(__OpenBSD__)
char *
strchrnul(const char *s, int c)
{
const char *p = s;
while (*p)
{
if (*p == c)
return (char *)p;
++p;
}
return (char *) (p);
}
#endif
static int
_xterm_parse_color(Termpty *ty, Eina_Unicode **ptr,
unsigned char *r, unsigned char *g, unsigned char *b,