#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
break;
case F_BOTH:
case F_NAME:
- if (islower(*p) || isdigit(*p) || *p == '-') {
- if (kidx == 0 && !islower(*p))
+ if ((*p >= 'a' && *p <= 'z') ||
+ (*p >= '0' && *p <= '9') || *p == '-') {
+ if (kidx == 0 && !(*p >= 'a' && *p <= 'z'))
/* Illegal sequence. */
return (-1);
if (kidx >= keysize -1)
return (-1);
++p;
state = G_VALUE;
- } else if (isspace(*p)) {
+ } else if (*p == ' ') {
/* Pass the space character */
++p;
} else {
* format which the fn variable
* indicate. */
state = INIT;
- } else if (isspace(*p)) {
+ } else if (*p == ' ') {
/* Pass the space character */
++p;
} else {
__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_set_compression_gzip.c,v 1.16 2008/02/21 03:21:50 kientzle Exp $");
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
if (strcmp(key, "compression-level") == 0) {
int level;
- if (value == NULL || !isdigit(value[0]) || value[1] != '\0')
+ if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+ value[1] != '\0')
return (ARCHIVE_WARN);
level = value[0] - '0';
if (level == state->compression_level)
__FBSDID("$FreeBSD$");
-#ifdef HAVE_CTYPE_H
-#include <ctype.h>
-#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
*/
int level;
- if (value == NULL || !isdigit(value[0]) || value[1] != '\0')
+ if (value == NULL || !(value[0] >= '0' && value[0] <= '9') ||
+ value[1] != '\0')
return (ARCHIVE_WARN);
level = value[0] - '0';
if (level == state->compression_level)