diff options
author | Brad King <brad.king@kitware.com> | 2017-02-23 11:57:26 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-23 12:15:21 (GMT) |
commit | d49176e91e4fb4ae31be1011c1029ca07d2cf494 (patch) | |
tree | a351407108be8d4ba8f8bb5c45cd95a64fd5b25f /Utilities/cmlibarchive/libarchive | |
parent | ce8f117fe2c10f1ebd56cb8adec0dcde1fc62457 (diff) | |
download | CMake-d49176e91e4fb4ae31be1011c1029ca07d2cf494.zip CMake-d49176e91e4fb4ae31be1011c1029ca07d2cf494.tar.gz CMake-d49176e91e4fb4ae31be1011c1029ca07d2cf494.tar.bz2 |
libarchive: Avoid using isblank
It is not available on VS 2012 and below. Use our own impl instead.
Diffstat (limited to 'Utilities/cmlibarchive/libarchive')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c b/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c index 5e22438..c3e86c0 100644 --- a/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c +++ b/Utilities/cmlibarchive/libarchive/archive_read_support_format_warc.c @@ -531,6 +531,10 @@ time_from_tm(struct tm *t) #endif } +static int la_isblank(int c) { + return c == ' ' || c == '\t'; +} + static time_t xstrpisotime(const char *s, char **endptr) { @@ -543,7 +547,7 @@ xstrpisotime(const char *s, char **endptr) /* as a courtesy to our callers, and since this is a non-standard * routine, we skip leading whitespace */ - while (isblank((unsigned char)*s)) + while (la_isblank((unsigned char)*s)) ++s; /* read year */ @@ -619,7 +623,7 @@ _warc_rdver(const char *buf, size_t bsz) if (memcmp(buf + 3U + end, "\r\n", 2U) != 0) ver = 0U; } else if (ver < 1200U) { - if (!isblank(*(buf + 3U + end))) + if (!la_isblank(*(buf + 3U + end))) ver = 0U; } } @@ -643,7 +647,7 @@ _warc_rdtyp(const char *buf, size_t bsz) } /* overread whitespace */ - while (val < eol && isblank((unsigned char)*val)) + while (val < eol && la_isblank((unsigned char)*val)) ++val; if (val + 8U == eol) { @@ -673,7 +677,7 @@ _warc_rduri(const char *buf, size_t bsz) return res; } - while (val < eol && isblank((unsigned char)*val)) + while (val < eol && la_isblank((unsigned char)*val)) ++val; /* overread URL designators */ @@ -731,7 +735,7 @@ _warc_rdlen(const char *buf, size_t bsz) } /* skip leading whitespace */ - while (val < eol && isblank(*val)) + while (val < eol && la_isblank(*val)) val++; /* there must be at least one digit */ if (!isdigit(*val)) |