-Subproject commit 78b62f8320f8dffb813222c1480563ed14251ca3
+Subproject commit 0e8fd2c0eed44dba1d39840a8733c9159220d671
argp-version-etc
attribute
backupfile
+c-ctype
closeout
configmake
dirname
# include <config.h>
#endif
+#include <wordsplit.h>
+
#include <errno.h>
-#include <ctype.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <pwd.h>
#include <glob.h>
+#include <c-ctype.h>
+
#if ENABLE_NLS
# include <gettext.h>
#else
#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
-#include <wordsplit.h>
-
#define ISWS(c) ((c)==' '||(c)=='\t'||(c)=='\n')
#define ISDELIM(ws,c) \
(strchr ((ws)->ws_delim, (c)) != NULL)
-#define ISPUNCT(c) (strchr("!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",(c))!=NULL)
-#define ISUPPER(c) ('A' <= ((unsigned) (c)) && ((unsigned) (c)) <= 'Z')
-#define ISLOWER(c) ('a' <= ((unsigned) (c)) && ((unsigned) (c)) <= 'z')
-#define ISALPHA(c) (ISUPPER(c) || ISLOWER(c))
-#define ISDIGIT(c) ('0' <= ((unsigned) (c)) && ((unsigned) (c)) <= '9')
-#define ISXDIGIT(c) (strchr("abcdefABCDEF", c)!=NULL)
-#define ISALNUM(c) (ISALPHA(c) || ISDIGIT(c))
-#define ISPRINT(c) (' ' <= ((unsigned) (c)) && ((unsigned) (c)) <= 127)
-
-#define ISVARBEG(c) (ISALPHA(c) || c == '_')
-#define ISVARCHR(c) (ISALNUM(c) || c == '_')
+
+#define ISVARBEG(c) (c_isalpha (c) || c == '_')
+#define ISVARCHR(c) (c_isalnum (c) || c == '_')
#define WSP_RETURN_DELIMS(wsp) \
((wsp)->ws_flags & WRDSF_RETURN_DELIMS || ((wsp)->ws_options & WRDSO_MAXWORDS))
if (command[i] == ';')
i++;
- if (!(command[i] == 's' && i + 3 < len && ISPUNCT (command[i + 1])))
+ if (!(command[i] == 's' && i + 3 < len && c_ispunct (command[i + 1])))
break;
delim = command[++i];
{
if (state == 3)
{
- if (command[i] == delim || !ISALNUM (command[i]))
+ if (command[i] == delim || !c_isalnum (command[i]))
break;
}
else if (command[i] == '\\')
start = i;
if (wsp->ws_flags & WRDSF_SED_EXPR
- && command[i] == 's' && i + 3 < len && ISPUNCT (command[i + 1]))
+ && command[i] == 's' && i + 3 < len && c_ispunct (command[i + 1]))
{
flags = _WSNF_SEXP;
i = skip_sed_expr (command, i, len);
}
#define to_num(c) \
- (ISDIGIT(c) ? c - '0' : (ISXDIGIT(c) ? toupper(c) - 'A' + 10 : 255 ))
+ (c_isdigit(c) ? c - '0' : c_isxdigit (c) ? c_toupper (c) - 'A' + 10 : 255)
static int
xtonum (int *pval, const char *src, int base, int cnt)
len++;
else if (*str == '"')
len += 2;
- else if (*str != '\t' && *str != '\\' && ISPRINT (*str))
+ else if (*str != '\t' && *str != '\\' && c_isprint (*str))
len++;
else if (quote_hex)
len += 3;
}
}
else if (WRDSO_ESC_TEST (ws, inquote, WRDSO_OESC)
- && (unsigned char) src[i] < 128 && ISDIGIT (src[i]))
+ && (unsigned char) src[i] < 128 && c_isdigit (src[i]))
{
if (n - i < 1)
{
*dst++ = '\\';
*dst++ = *src;
}
- else if (*src != '\t' && *src != '\\' && ISPRINT (*src))
+ else if (*src != '\t' && *src != '\\' && c_isprint (*src))
*dst++ = *src;
else
{
-Subproject commit 481bae11050fcbdca67a66eb57390267b280a312
+Subproject commit d56df6838db922686bdfb3325f6368d295ae7f15
#include <signal.h>
+#include <c-ctype.h>
#include <closeout.h>
#include <fnmatch.h>
#include <human.h>
idx_t prefix_len = 0;
for (idx_t i = 0; label[i]; i++)
- if (!isdigit ((unsigned char) label[i]))
+ if (!c_isdigit (label[i]))
prefix_len = i + 1;
ptrdiff_t len = prefix_len - VOLUME_TEXT_LEN;
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <system.h>
+#include <c-ctype.h>
#include <quotearg.h>
#include <flexmember.h>
#include <fnmatch.h>
git_addfn (struct exclude *ex, char const *pattern, int options,
MAYBE_UNUSED void *data)
{
- while (isspace (*pattern))
+ while (c_isspace (*pattern))
++pattern;
if (*pattern == 0 || *pattern == '#')
return;
bzr_addfn (struct exclude *ex, char const *pattern, int options,
MAYBE_UNUSED void *data)
{
- while (isspace (*pattern))
+ while (c_isspace (*pattern))
++pattern;
if (*pattern == 0 || *pattern == '#')
return;
int *hgopt = data;
size_t len;
- while (isspace (*pattern))
+ while (c_isspace (*pattern))
++pattern;
if (*pattern == 0 || *pattern == '#')
return;
if (strncmp (pattern, "syntax:", 7) == 0)
{
- for (pattern += 7; isspace (*pattern); ++pattern)
+ for (pattern += 7; c_isspace (*pattern); ++pattern)
;
if (strcmp (pattern, "regexp") == 0)
/* FIXME: Regexps must be perl-style */
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <system.h>
+#include <c-ctype.h>
#include <hash.h>
#include <quotearg.h>
#include "common.h"
int c = getc (fp);
bool negative = c == '-';
- for (i = 0; (i == 0 && negative) || ISDIGIT (c); i++)
+ for (i = 0; (i == 0 && negative) || c_isdigit (c); i++)
{
buf[i] = c;
if (i == sizeof buf - 1)
Written by John Gilmore, on 1985-08-26. */
#include <system.h>
+#include <c-ctype.h>
#include <inttostr.h>
#include <quotearg.h>
#include <time.h>
type));
return -1;
}
- if (!isspace ((unsigned char) *where))
+ if (!c_isspace (*where))
break;
where++;
}
value = -value;
}
- if (where != lim && *where && !isspace ((unsigned char) *where))
+ if (where != lim && *where && !c_isspace (*where))
{
if (type)
{
#include <system.h>
#include <rmt.h>
#include "common.h"
+#include <c-ctype.h>
#include <quotearg.h>
#include <xgetcwd.h>
#include <unlinkdir.h>
errno = 0;
if (maxval <= INTMAX_MAX)
{
- if (ISDIGIT (arg[*arg == '-']))
+ if (c_isdigit (arg[*arg == '-']))
{
intmax_t i = strtoimax (arg, arglim, 10);
intmax_t imaxval = maxval;
}
else
{
- if (ISDIGIT (*arg))
+ if (c_isdigit (*arg))
{
uintmax_t i = strtoumax (arg, arglim, 10);
if (i <= maxval)
bool negative = *arg == '-';
struct timespec r;
- if (! ISDIGIT (arg[negative]))
+ if (! c_isdigit (arg[negative]))
errno = EINVAL;
else
{
int digits = 0;
bool trailing_nonzero = false;
- while (ISDIGIT (*++p))
+ while (c_isdigit (*++p))
if (digits < LOG10_BILLION)
digits++, ns = 10 * ns + (*p - '0');
else
#include <system.h>
+#include <c-ctype.h>
#include <fnmatch.h>
#include <hash.h>
#include <quotearg.h>
int i;
struct option_locus loc;
- while (*str && isspace (*str))
+ while (*str && c_isspace (*str))
++str;
if (*str != '-')
return 1;
with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <system.h>
+#include <c-ctype.h>
#include <inttostr.h>
#include <quotearg.h>
#include "common.h"
uintmax_t u;
char *arg_lim;
- if (!ISDIGIT (*arg))
+ if (!c_isdigit (*arg))
return false;
errno = 0;
#include "common.h"
#include <argmatch.h>
+#include <c-ctype.h>
#include <closeout.h>
#include <configmake.h>
#include <exitfail.h>
size_t len = p - arg + 1;
obstack_grow (&stk, arg, len);
len = seglen - len;
- for (++p; *p && isspace ((unsigned char) *p); p++)
+ for (++p; *p && c_isspace (*p); p++)
len--;
if (*p == '{' && p[len-1] == '}')
{
case SET_MTIME_FORMAT_OPTION:
set_mtime_format = arg;
break;
-
+
case SPARSE_VERSION_OPTION:
sparse_option = true;
{
with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <system.h>
+#include <ctype.h>
#include <regex.h>
#include "common.h"
#include <system.h>
+#include <c-ctype.h>
#include <fnmatch.h>
#include <hash.h>
#include <inttostr.h>
global = false;
}
- while (p > kw && isspace ((unsigned char) *p))
+ while (p > kw && c_isspace (*p))
p--;
*p = 0;
- for (p = eq + 1; *p && isspace ((unsigned char) *p); p++)
+ for (p = eq + 1; *p && c_isspace (*p); p++)
;
if (strcmp (kw, "delete") == 0)
while (*p == ' ' || *p == '\t')
p++;
- if (! ISDIGIT (*p))
+ if (! c_isdigit (*p))
{
if (*p)
ERROR ((0, 0, _("Malformed extended header: missing length")));
intmax_t u;
char *delim;
- if (!ISDIGIT (*arg))
+ if (!c_isdigit (*arg))
{
ERROR ((0, 0, _("Malformed extended header: invalid %s=%s"),
keyword, arg));