From 1a984e6cca24a77b3c62253a605f3645d25d459e Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Wed, 6 Apr 2011 09:13:03 -0400 Subject: Starting to port to Solaris 10... sigh. --- duser.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'duser.c') diff --git a/duser.c b/duser.c index b8f7278..776e142 100644 --- a/duser.c +++ b/duser.c @@ -1,4 +1,5 @@ #define _GNU_SOURCE + #include #include #include @@ -9,6 +10,11 @@ #include #include #include + +#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 1) +# define HAVE_STRCHRNUL +#endif + #include "duser.h" char list_path[PATH_MAX]; @@ -25,6 +31,18 @@ int CMD_FLAG_HELP = 0; int CMD_FLAG_LOOK = 0; int CMD_FLAG_NULL = 0; +#ifndef HAVE_STRCHRNUL +char *dstrchrnul(const char* s, int c) +{ + while(*s && *s != c) + { + s++; + } + + return (char*)s; +} +#endif + int user_del_list(const char* filename) { char tmp[PATH_MAX]; -- cgit