mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-03-18 05:34:23 -04:00
opt: allowe space on both sides of the plus sign when parse mod key
This commit is contained in:
parent
028cf6e49e
commit
17434d6262
1 changed files with 8 additions and 3 deletions
|
|
@ -634,9 +634,14 @@ uint32_t parse_mod(const char *mod_str) {
|
||||||
// 分割处理每个部分
|
// 分割处理每个部分
|
||||||
token = strtok_r(input_copy, "+", &saveptr);
|
token = strtok_r(input_copy, "+", &saveptr);
|
||||||
while (token != NULL) {
|
while (token != NULL) {
|
||||||
// 去除空白
|
// 去除前后空白
|
||||||
while (*token == ' ' || *token == '\t')
|
trim_whitespace(token);
|
||||||
token++;
|
|
||||||
|
// 如果 token 变成空字符串则跳过
|
||||||
|
if (*token == '\0') {
|
||||||
|
token = strtok_r(NULL, "+", &saveptr);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (strncmp(token, "code:", 5) == 0) {
|
if (strncmp(token, "code:", 5) == 0) {
|
||||||
// 处理 code: 形式
|
// 处理 code: 形式
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue