From: Paul Eggert Date: Tue, 17 Sep 2024 23:54:17 +0000 (-0700) Subject: Use c-ctype.h in lib-src X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b94f3ce38ccbd15f0d566e17a0267134699f6ceb;p=emacs.git Use c-ctype.h in lib-src This fixes some unlikely bugs and removes the temptation of using ctype.h. Although some uses were correct, many weren't. * lib-src/ebrowse.c: Include c-ctype.h, not ctype.h. * lib-src/emacsclient.c: Include c-ctype.h, not ctype.h. * lib-src/update-game-score.c: Include c-ctype.h, not ctype.h. All uses changed. (cherry picked from commit 865b54e2acea4fdaa3f302ed225f50281b371d6e) --- diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c index 8e64f1e92d3..c1ffa1480ec 100644 --- a/lib-src/emacsclient.c +++ b/lib-src/emacsclient.c @@ -68,7 +68,6 @@ char *w32_getenv (const char *); #define DEFAULT_TIMEOUT (30) -#include #include #include #include @@ -83,6 +82,7 @@ char *w32_getenv (const char *); #include #include +#include #include #include #include @@ -2124,7 +2124,7 @@ main (int argc, char **argv) unsigned char c; do c = *++p; - while (isdigit (c) || c == ':'); + while (c_isdigit (c) || c == ':'); if (c == 0) { @@ -2136,7 +2136,7 @@ main (int argc, char **argv) } #ifdef WINDOWSNT else if (! IS_ABSOLUTE_FILE_NAME (argv[i]) - && (isalpha (argv[i][0]) && argv[i][1] == ':')) + && (c_isalpha (argv[i][0]) && argv[i][1] == ':')) /* Windows can have a different default directory for each drive, so the cwd passed via "-dir" is not sufficient to account for that. diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c index e3b24ad7717..7545d0390c1 100644 --- a/lib-src/update-game-score.c +++ b/lib-src/update-game-score.c @@ -41,11 +41,11 @@ along with GNU Emacs. If not, see . */ #include #include #include -#include #include #include #include +#include #include #ifdef WINDOWSNT @@ -143,7 +143,7 @@ normalize_integer (char *num) { bool neg; char *p; - while (*num != '\n' && isspace (*num)) + while (*num != '\n' && c_isspace (*num)) num++; neg = *num == '-'; num += neg || *num == '-';