From: Todd C. Miller Date: Thu, 6 Nov 2008 00:05:24 +0000 (+0000) Subject: Add isblank() function for systems without it. Needed for POSIX X-Git-Tag: SUDO_1_7_0~53 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8654dec3c001779909051a3765a79c347a942b20;p=sudo Add isblank() function for systems without it. Needed for POSIX character class matching in fnmatch.c and glob.c. --- diff --git a/isblank.c b/isblank.c new file mode 100644 index 000000000..67c64f972 --- /dev/null +++ b/isblank.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2008 Todd C. Miller + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +#include + +#ifndef lint +__unused static const char rcsid[] = "$Sudo$"; +#endif /* lint */ + +#undef isblank +int +isblank(ch) + int ch; +{ + return(ch == ' ' || ch == '\t'); +}