This is a minor portability fix - isdigit() (and friends) are only portably defined for unsigned char values (though glibc extends them to work for signed char too) so this fixes this code to handle top bit set characters on non-glibc platforms where char is signed by default.

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12846 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Olly Betts 2011-11-28 04:08:25 +00:00
commit 5b8ca942ad

View file

@ -1165,7 +1165,7 @@ String *replace_captures(const char *input, String *subst, int captures[])
/* Handle substitution */
if (*p == '\0') {
Putc('\\', result);
} else if (isdigit((int)*p)) {
} else if (isdigit((unsigned char)*p)) {
int group = *p++ - '0';
int l = captures[group*2], r = captures[group*2 + 1];
if (l != -1) {