--- src/terminal-util.c.orig 2017-09-13 13:44:09.000000000 -0700 +++ src/terminal-util.c 2017-09-13 13:46:36.000000000 -0700 @@ -30,6 +30,22 @@ #include #include +#ifdef __APPLE__ + +/* As of Sierra, Mac OS X, macOS does not provide strchrnul() */ +/* Find the first occurrence of C in S or the final NUL byte. */ + +static char * +strchrnul (const char *s, int c_in) +{ + char c = c_in; + while (*s && (*s != c)) + s++; + + return (char *) s; +} + +#endif #include #include