From: Ian Jackson Date: Thu, 20 Mar 2008 05:12:05 +0000 (+0200) Subject: Add new cisspace function X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c91dc9f7e97c8f1299c3aea5aec6dbee6a909b7c;p=dpkg Add new cisspace function --- diff --git a/ChangeLog b/ChangeLog index 02345a74..165bb26d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-20 Ian Jackson + + * lib/dpkg.h (cisspace): New prototype. + * lib/utils.c (cisspace): New function definition. + 2008-03-20 Ian Jackson * src/main.h (pkgadminfile): Move prototype to ... diff --git a/lib/dpkg.h b/lib/dpkg.h index 17b8f28b..7184c681 100644 --- a/lib/dpkg.h +++ b/lib/dpkg.h @@ -362,6 +362,7 @@ extern volatile int onerr_abort; int cisdigit(int c); int cisalpha(int c); +int cisspace(int c); int fgets_checked(char *buf, size_t bufsz, FILE *f, const char *fn); int fgets_must(char *buf, size_t bufsz, FILE *f, const char *fn); diff --git a/lib/utils.c b/lib/utils.c index 632df1ed..87f6b7c7 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -34,6 +34,12 @@ int cisalpha(int c) { return ((c>='a') && (c<='z')) || ((c>='A') && (c<='Z')); } +int +cisspace(int c) +{ + return (c == '\n' || c == '\t' || c == ' '); +} + int fgets_checked(char *buf, size_t bufsz, FILE *f, const char *fn) {