From: Todd C. Miller Date: Mon, 3 Nov 2008 18:19:14 +0000 (+0000) Subject: Add isblank() function for systems without it. Needed for POSIX X-Git-Tag: SUDO_1_7_0~58 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48329f0e43002cc3c78bf347d48416fb23d7c9f3;p=sudo Add isblank() function for systems without it. Needed for POSIX character class matching in fnmatch.c and glob.c. --- diff --git a/Makefile.in b/Makefile.in index ccd7f2981..106bc13cd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -105,11 +105,11 @@ PROGS = @PROGS@ SRCS = aix.c alias.c alloc.c check.c closefrom.c def_data.c defaults.c env.c \ error.c fileops.c find_path.c fnmatch.c getcwd.c getprogname.c \ getspwuid.c gettime.c glob.c goodpath.c gram.c gram.y interfaces.c \ - lbuf.c ldap.c list.c logging.c match.c mkstemp.c memrchr.c parse.c \ - pwutil.c set_perms.c sigaction.c snprintf.c strcasecmp.c strerror.c \ - strlcat.c strlcpy.c sudo.c sudo_noexec.c sudo_edit.c sudo_nss.c \ - testsudoers.c tgetpass.c toke.c toke.l tsgetgrpw.c utimes.c visudo.c \ - zero_bytes.c redblack.c selinux.c sesh.c $(AUTH_SRCS) + isblank.c lbuf.c ldap.c list.c logging.c match.c mkstemp.c memrchr.c \ + parse.c pwutil.c set_perms.c sigaction.c snprintf.c strcasecmp.c \ + strerror.c strlcat.c strlcpy.c sudo.c sudo_noexec.c sudo_edit.c \ + sudo_nss.c testsudoers.c tgetpass.c toke.c toke.l tsgetgrpw.c utimes.c \ + visudo.c zero_bytes.c redblack.c selinux.c sesh.c $(AUTH_SRCS) AUTH_SRCS = auth/afs.c auth/aix_auth.c auth/bsdauth.c auth/dce.c auth/fwtk.c \ auth/kerb4.c auth/kerb5.c auth/pam.c auth/passwd.c auth/rfc1938.c \ @@ -258,6 +258,8 @@ gram.o: $(devdir)/gram.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h $(devdir) $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(devdir)/gram.c interfaces.o: $(srcdir)/interfaces.c $(SUDODEP) $(srcdir)/interfaces.h $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/interfaces.c +isblank.o: $(srcdir)/isblank.c $(srcdir)/compat.h config.h + $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/isblank.c lbuf.o: $(srcdir)/lbuf.c $(SUDODEP) $(CC) -c $(CPPFLAGS) $(CFLAGS) $(DEFS) $(OPTIONS) $(srcdir)/lbuf.c ldap.o: $(srcdir)/ldap.c $(SUDODEP) $(srcdir)/parse.h $(srcdir)/list.h diff --git a/aclocal.m4 b/aclocal.m4 index 136d87043..13089f090 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -225,6 +225,8 @@ AC_DEFUN([SUDO_FUNC_ISBLANK], ] [ if test "$sudo_cv_func_isblank" = "yes"; then AC_DEFINE(HAVE_ISBLANK, 1, [Define if you have isblank(3).]) + else + AC_LIBOBJ(isblank) fi ]) diff --git a/compat.h b/compat.h index d7a45cbd3..ae42b0f31 100644 --- a/compat.h +++ b/compat.h @@ -152,9 +152,10 @@ #endif /* - * Simple isblank() macro for systems without it. + * Simple isblank() macro and function for systems without it. */ #ifndef HAVE_ISBLANK +int isblank __P((int)); # define isblank(_x) ((_x) == ' ' || (_x) == '\t') #endif diff --git a/configure b/configure index 9ff25ea35..f6384086e 100755 --- a/configure +++ b/configure @@ -17250,6 +17250,13 @@ cat >>confdefs.h <<\_ACEOF #define HAVE_ISBLANK 1 _ACEOF + else + case " $LIBOBJS " in + *" isblank.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS isblank.$ac_objext" + ;; +esac + fi