| | 539 | | void eval_special_string(const char *cmd, const char *data, | | | 540 | | SERVER_REC *server, void *item) | | | 541 | | { | | | 542 | | const char *cmdchars; | | | 543 | | char *orig, *str, *start, *ret; | | | 544 | | int arg_used, arg_used_ever; | | | 545 | | GSList *commands; | | | 546 | | | | | 547 | | commands = NULL;
| | | 548 | | arg_used_ever = FALSE;
| | | 549 | | cmdchars = settings_get_str("cmdchars"); | | | 550 | | | | | 551 | | | | | 552 | | orig = start = str = g_strdup(cmd); | | | 553 | | do { | | | 554 | | if (is_split_char(str, start)) {
| | | 555 | | *str++ = '\0'; | | | 556 | | while (*str == ' ') str++; | | | 557 | | } else if (*str != '\0') { | | | 558 | | str++; | | | 559 | | continue; | | | 560 | | } | | | 561 | | | | | 562 | | ret = parse_special_string(start, server, item, |
| | 482 | | | | char *parse_special_string(const char *cmd, SERVER_REC *server, void *item, | | | 483 | | | | const char *data, int *arg_used, int flags) | | | 484 | | | | { | | | 485 | | | | char code, **arglist, *ret; | | | 486 | | | | GString *str; | | | 487 | | | | int need_free, chr; | | | 488 | | | | | | | 489 | | | | g_return_val_if_fail(cmd != NULL, NULL);
| | true | 490 | | | | g_return_val_if_fail(data != NULL, NULL);
| | | 491 | | | | | | | 492 | | | | | | | 493 | | | | arglist = g_strsplit(data, " ", -1); | | | 494 | | | | | | | 495 | | | | if (arg_used != NULL) *arg_used = FALSE;
| | | 496 | | | | code = 0; | | | 497 | | | | str = g_string_new(NULL);
| | | 498 | | | | while (*cmd != '\0') { | | | 499 | | | | if (code == '\\') { | | | 500 | | | | if (*cmd == ';') | | | | | | | ... | | | 522 | | | | g_string_append_c(str, *cmd);
| | | 523 | | | | } | | | 524 | | | | | | | 525 | | | | cmd++; | | | 526 | | | | } | | | 527 | | | | g_strfreev(arglist); | | | 528 | | | | | | | 529 | | | | ret = str->str; | | | 530 | | | | g_string_free(str, FALSE);
| | | 531 | | | | return ret; | | parse_special_string$return <= 4095 | 532 | | | | } | Problem | | parse_special_string$return <= 4095 |
|
|