|
44 | 44 | #include "unicode.h"
|
45 | 45 | #include "whereami.h"
|
46 | 46 |
|
47 |
| -#ifdef HAVE_GETTEXT |
| 47 | +#ifndef NO_GETTEXT |
48 | 48 | #include <libintl.h>
|
49 | 49 | #include <locale.h>
|
50 | 50 | #else
|
@@ -87,9 +87,9 @@ int AddTestSuites(CuSuite * suite, const char *names);
|
87 | 87 |
|
88 | 88 | #include <string.h>
|
89 | 89 |
|
90 |
| -#define isxspace(c) (c==194 || c==160 || isspace(c)) |
| 90 | +#define isxspace(c) ((c)==194 || (c)==160 || isspace(c)) |
91 | 91 |
|
92 |
| -static const char *echeck_version = "4.5.7"; |
| 92 | +static const char *echeck_version = "4.5.8"; |
93 | 93 |
|
94 | 94 | #define DEFAULT_PATH "."
|
95 | 95 |
|
@@ -783,8 +783,9 @@ int Pow(int p)
|
783 | 783 |
|
784 | 784 | #define iswxspace(c) (c==160 || iswspace(c))
|
785 | 785 |
|
786 |
| -char *eatwhite(char *ptr) |
| 786 | +char *eatwhite(char *input) |
787 | 787 | {
|
| 788 | + unsigned char *ptr = (unsigned char *)input; |
788 | 789 | while (*ptr) {
|
789 | 790 | ucs4_t ucs;
|
790 | 791 | size_t size = 0;
|
@@ -1062,11 +1063,10 @@ void readskill(char *s)
|
1062 | 1063 | }
|
1063 | 1064 | sk->name = STRDUP(transliterate(buffer, sizeof(buffer), s));
|
1064 | 1065 | if (x) {
|
1065 |
| - s = (char *)(x + 1); |
1066 |
| - while (isxspace(*s)) |
1067 |
| - s++; |
1068 |
| - if (*s) |
1069 |
| - sk->kosten = atoi(s); |
| 1066 | + unsigned char *p = (unsigned char *)(x + 1); |
| 1067 | + while (isxspace(*p)) ++p; |
| 1068 | + if (*p) |
| 1069 | + sk->kosten = atoi(p); |
1070 | 1070 | }
|
1071 | 1071 | sk->next = skilldata;
|
1072 | 1072 | skilldata = sk;
|
@@ -1310,7 +1310,7 @@ int parsefile(char *s, int typ)
|
1310 | 1310 | if (!x)
|
1311 | 1311 | return 0;
|
1312 | 1312 | y = x + 1;
|
1313 |
| - while (isxspace(*(x - 1))) |
| 1313 | + while (isxspace(*((unsigned char *)x - 1))) |
1314 | 1314 | x--;
|
1315 | 1315 | *x = 0;
|
1316 | 1316 | for (i = 1; i < UT_MAX; i++)
|
@@ -2115,15 +2115,15 @@ char *getbuf(void)
|
2115 | 2115 | if (c > 0 && isxspace(c)) {
|
2116 | 2116 | if (eatwhite) {
|
2117 | 2117 | do {
|
2118 |
| - c = *(++bp); |
| 2118 | + c = *(unsigned char *)++bp; |
2119 | 2119 | }
|
2120 | 2120 | while (bp != lbuf + MAXLINE && isxspace(*bp));
|
2121 | 2121 | if (!quote && !start)
|
2122 | 2122 | *(cp++) = ' ';
|
2123 | 2123 | } else {
|
2124 | 2124 | do {
|
2125 | 2125 | *(cp++) = SPACE_REPLACEMENT;
|
2126 |
| - c = *(++bp); |
| 2126 | + c = *(unsigned char *)++bp; |
2127 | 2127 | }
|
2128 | 2128 | while (cp != warn_buf + MAXLINE && bp != lbuf + MAXLINE
|
2129 | 2129 | && c > 0 && isxspace(c));
|
@@ -5020,7 +5020,7 @@ void process_order_file(int *faction_count, int *unit_count)
|
5020 | 5020 | x = strchr(order_buf, ';');
|
5021 | 5021 | if (x) {
|
5022 | 5022 | x++;
|
5023 |
| - while (isxspace(*x)) |
| 5023 | + while (isxspace(*(unsigned char *)x)) |
5024 | 5024 | x++;
|
5025 | 5025 | if (r->name)
|
5026 | 5026 | free(r->name);
|
@@ -5300,7 +5300,7 @@ void init(void)
|
5300 | 5300 | filename = getenv("ECHECKOPTS");
|
5301 | 5301 | }
|
5302 | 5302 |
|
5303 |
| -#ifdef HAVE_GETTEXT |
| 5303 | +#ifndef NO_GETTEXT |
5304 | 5304 | #ifdef WIN32
|
5305 | 5305 | #define PATH_SEP '\\'
|
5306 | 5306 | #else
|
@@ -5351,7 +5351,7 @@ void init_intl(void)
|
5351 | 5351 | int main(int argc, char *argv[])
|
5352 | 5352 | {
|
5353 | 5353 | int faction_count = 0, unit_count = 0, nextarg = 1, i;
|
5354 |
| -#ifdef HAVE_GETTEXT |
| 5354 | +#ifndef NO_GETTEXT |
5355 | 5355 | init_intl();
|
5356 | 5356 | #endif
|
5357 | 5357 | #if macintosh
|
|
0 commit comments