summaryrefslogtreecommitdiff
path: root/src/core/special-vars.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-01-27 20:45:59 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-01-27 20:45:59 +0000
commitf4897860b50e2d1cc3b97a00d1f5a2e9e9c04faa (patch)
treea9d1400865e53ac8e5b68ca37b1cb9d081bd8467 /src/core/special-vars.c
parent820c9d3d8288c8d6dfb3172750bc26adea76f66c (diff)
downloadirssi-f4897860b50e2d1cc3b97a00d1f5a2e9e9c04faa.zip
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
Diffstat (limited to 'src/core/special-vars.c')
-rw-r--r--src/core/special-vars.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/core/special-vars.c b/src/core/special-vars.c
index d961bd58..36d0743c 100644
--- a/src/core/special-vars.c
+++ b/src/core/special-vars.c
@@ -30,10 +30,10 @@
#define ALIGN_PAD 0x04
#define isvarchar(c) \
- (isalnum(c) || (c) == '_')
+ (i_isalnum(c) || (c) == '_')
#define isarg(c) \
- (isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-')
+ (i_isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-')
static SPECIAL_HISTORY_FUNC history_func = NULL;
@@ -54,7 +54,7 @@ static char *get_argument(char **cmd, char **arglist)
/* get last argument */
arg = max = argcount-1;
} else {
- if (isdigit(**cmd)) {
+ if (i_isdigit(**cmd)) {
/* first argument */
arg = max = (**cmd)-'0';
(*cmd)++;
@@ -63,7 +63,7 @@ static char *get_argument(char **cmd, char **arglist)
if (**cmd == '-') {
/* get more than one argument */
(*cmd)++;
- if (!isdigit(**cmd))
+ if (!i_isdigit(**cmd))
max = -1; /* get all the rest */
else {
max = (**cmd)-'0';
@@ -163,7 +163,7 @@ static char *get_variable(char **cmd, SERVER_REC *server, void *item,
get_argument(cmd, arglist);
}
- if (isalpha(**cmd) && isvarchar((*cmd)[1])) {
+ if (i_isalpha(**cmd) && isvarchar((*cmd)[1])) {
/* long variable name.. */
return get_long_variable(cmd, server, item, free_ret, getname);
}
@@ -287,7 +287,7 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad)
/* '!' = don't cut, '-' = right padding */
str = *data;
- while (*str != '\0' && *str != ']' && !isdigit(*str)) {
+ while (*str != '\0' && *str != ']' && !i_isdigit(*str)) {
if (*str == '!')
*flags &= ~ALIGN_CUT;
else if (*str == '-')
@@ -296,11 +296,11 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad)
*flags &= ~ALIGN_PAD;
str++;
}
- if (!isdigit(*str))
+ if (!i_isdigit(*str))
return FALSE; /* expecting number */
/* get the alignment size */
- while (isdigit(*str)) {
+ while (i_isdigit(*str)) {
*align = (*align) * 10 + (*str-'0');
str++;
}