toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in some

systems, use our own is_...() functions now instead.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-01-27 20:45:59 +00:00 committed by cras
commit f4897860b5
35 changed files with 112 additions and 95 deletions

View file

@ -293,9 +293,9 @@ void gui_entry_erase_word(GUI_ENTRY_REC *entry, int to_space)
while (entry->text->str[to] != ' ' && to > 0)
to--;
} else {
while (!isalnum(entry->text->str[to]) && to > 0)
while (!i_isalnum(entry->text->str[to]) && to > 0)
to--;
while (isalnum(entry->text->str[to]) && to > 0)
while (i_isalnum(entry->text->str[to]) && to > 0)
to--;
}
if (to > 0) to++;
@ -323,9 +323,9 @@ void gui_entry_erase_next_word(GUI_ENTRY_REC *entry, int to_space)
while (entry->text->str[to] != ' ' && to < entry->text->len)
to++;
} else {
while (!isalnum(entry->text->str[to]) && to < entry->text->len)
while (!i_isalnum(entry->text->str[to]) && to < entry->text->len)
to++;
while (isalnum(entry->text->str[to]) && to < entry->text->len)
while (i_isalnum(entry->text->str[to]) && to < entry->text->len)
to++;
}
@ -386,9 +386,9 @@ static void gui_entry_move_words_left(GUI_ENTRY_REC *entry, int count, int to_sp
while (pos > 0 && entry->text->str[pos-1] != ' ')
pos--;
} else {
while (pos > 0 && !isalnum(entry->text->str[pos-1]))
while (pos > 0 && !i_isalnum(entry->text->str[pos-1]))
pos--;
while (pos > 0 && isalnum(entry->text->str[pos-1]))
while (pos > 0 && i_isalnum(entry->text->str[pos-1]))
pos--;
}
count--;
@ -409,9 +409,9 @@ static void gui_entry_move_words_right(GUI_ENTRY_REC *entry, int count, int to_s
while (pos < entry->text->len && entry->text->str[pos] != ' ')
pos++;
} else {
while (pos < entry->text->len && !isalnum(entry->text->str[pos]))
while (pos < entry->text->len && !i_isalnum(entry->text->str[pos]))
pos++;
while (pos < entry->text->len && isalnum(entry->text->str[pos]))
while (pos < entry->text->len && i_isalnum(entry->text->str[pos]))
pos++;
}
count--;

View file

@ -265,7 +265,7 @@ static void check_oldcrap(void)
str[0] = '\0';
fgets(str, sizeof(str), stdin);
if (toupper(str[0]) == 'Y' || str[0] == '\n' || str[0] == '\0')
if (i_toupper(str[0]) == 'Y' || str[0] == '\n' || str[0] == '\0')
remove(path);
g_free(path);
}

View file

@ -964,7 +964,7 @@ static void cmd_window_stick(const char *data)
while (*data == ' ') data++;
}
if (g_strncasecmp(data, "OF", 2) == 0 || toupper(*data) == 'N') {
if (g_strncasecmp(data, "OF", 2) == 0 || i_toupper(*data) == 'N') {
/* unset sticky */
if (!WINDOW_GUI(win)->sticky) {
printformat_window(win, MSGLEVEL_CLIENTERROR,

View file

@ -568,7 +568,7 @@ char *tparm(const char *str, ...) {
return OOPS;
i = 0;
sp++;
while(isdigit(*sp))
while(i_isdigit(*sp))
i = 10 * i + *sp++ - '0';
if (*sp++ != '}' || pushnum(i))
return OOPS;