mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Allow any character in formspec strings with escape char
This commit is contained in:
parent
bdbdeab005
commit
ba78194636
5 changed files with 129 additions and 56 deletions
|
@ -286,6 +286,22 @@ inline std::string wrap_rows(const std::string &from, u32 rowlen)
|
|||
return to;
|
||||
}
|
||||
|
||||
/*
|
||||
Removes all \\ from a string that had been escaped (FormSpec strings)
|
||||
*/
|
||||
inline std::string unescape_string(std::string &s)
|
||||
{
|
||||
std::string res;
|
||||
|
||||
for (size_t i = 0; i <= s.length(); i++) {
|
||||
if (s[i] == '\\')
|
||||
i++;
|
||||
res += s[i];
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string translatePassword(std::string playername, std::wstring password);
|
||||
size_t curl_write_data(char *ptr, size_t size, size_t nmemb, void *userdata);
|
||||
u32 readFlagString(std::string str, FlagDesc *flagdesc);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue