From f4897860b50e2d1cc3b97a00d1f5a2e9e9c04faa Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 27 Jan 2002 20:45:59 +0000 Subject: 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 --- src/fe-text/gui-entry.c | 16 ++++++++-------- src/fe-text/irssi.c | 2 +- src/fe-text/mainwindows.c | 2 +- src/fe-text/tparm.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/fe-text') diff --git a/src/fe-text/gui-entry.c b/src/fe-text/gui-entry.c index 3ba30f90..fcaef077 100644 --- a/src/fe-text/gui-entry.c +++ b/src/fe-text/gui-entry.c @@ -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--; diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c index b2386579..66545265 100644 --- a/src/fe-text/irssi.c +++ b/src/fe-text/irssi.c @@ -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); } diff --git a/src/fe-text/mainwindows.c b/src/fe-text/mainwindows.c index 60fd3de9..50f8b93b 100644 --- a/src/fe-text/mainwindows.c +++ b/src/fe-text/mainwindows.c @@ -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, diff --git a/src/fe-text/tparm.c b/src/fe-text/tparm.c index 34a17f80..30c9cd0b 100644 --- a/src/fe-text/tparm.c +++ b/src/fe-text/tparm.c @@ -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; -- cgit v1.2.3