version 1.737, 2020/12/19 22:10:17 |
version 1.738, 2020/12/20 00:47:21 |
|
|
return AMR_OK; |
return AMR_OK; |
} |
} |
|
|
|
static char * |
|
str_toupper(const char *str) |
|
{ |
|
char *res; |
|
size_t i, len; |
|
|
|
len = strlen(str); |
|
res = bmake_malloc(len + 1); |
|
for (i = 0; i < len + 1; i++) |
|
res[i] = ch_toupper(str[i]); |
|
|
|
return res; |
|
} |
|
|
|
static char * |
|
str_tolower(const char *str) |
|
{ |
|
char *res; |
|
size_t i, len; |
|
|
|
len = strlen(str); |
|
res = bmake_malloc(len + 1); |
|
for (i = 0; i < len + 1; i++) |
|
res[i] = ch_tolower(str[i]); |
|
|
|
return res; |
|
} |
|
|
/* :tA, :tu, :tl, :ts<separator>, etc. */ |
/* :tA, :tu, :tl, :ts<separator>, etc. */ |
static ApplyModifierResult |
static ApplyModifierResult |
ApplyModifier_To(const char **pp, ApplyModifiersState *st) |
ApplyModifier_To(const char **pp, ApplyModifiersState *st) |
Line 2842 ApplyModifier_To(const char **pp, ApplyM |
|
Line 2870 ApplyModifier_To(const char **pp, ApplyM |
|
} |
} |
|
|
if (mod[1] == 'u') { /* :tu */ |
if (mod[1] == 'u') { /* :tu */ |
size_t i; |
st->newVal = str_toupper(st->val); |
size_t len = strlen(st->val); |
|
st->newVal = bmake_malloc(len + 1); |
|
for (i = 0; i < len + 1; i++) |
|
st->newVal[i] = ch_toupper(st->val[i]); |
|
*pp = mod + 2; |
*pp = mod + 2; |
return AMR_OK; |
return AMR_OK; |
} |
} |
|
|
if (mod[1] == 'l') { /* :tl */ |
if (mod[1] == 'l') { /* :tl */ |
size_t i; |
st->newVal = str_tolower(st->val); |
size_t len = strlen(st->val); |
|
st->newVal = bmake_malloc(len + 1); |
|
for (i = 0; i < len + 1; i++) |
|
st->newVal[i] = ch_tolower(st->val[i]); |
|
*pp = mod + 2; |
*pp = mod + 2; |
return AMR_OK; |
return AMR_OK; |
} |
} |