| 667 | int recursion_depth = 0); |
| 668 | |
| 669 | static string _getRandomisedStr(TextDB &db, const string &key, |
| 670 | const string &suffix, |
| 671 | int &num_replacements, |
| 672 | int recursion_depth = 0) |
| 673 | { |
| 674 | recursion_depth++; |
| 675 | if (recursion_depth > MAX_RECURSION_DEPTH) |
| 676 | { |
| 677 | mprf(MSGCH_DIAGNOSTICS, "Too many nested replacements, bailing."); |
| 678 | |
| 679 | return "TOO MUCH RECURSION"; |
| 680 | } |
| 681 | |
| 682 | string str = _getWeightedString(db, key, suffix); |
| 683 | |
| 684 | _call_recursive_replacement(str, db, suffix, num_replacements, |
| 685 | recursion_depth); |
| 686 | |
| 687 | return str; |
| 688 | } |
| 689 | |
| 690 | // Replace any "@foo@" markers that can be found in this database. |
| 691 | // Those that can't be found are left alone for the caller to deal with. |
no test coverage detected