1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Support underscore (_) in VFormat arg name

This is needed for the limits check in the translator menu.

This commit is part of rewritten history of the localization branch.
The original (unsquashed) commit history can be found here:
https://github.com/Dav999-v/VVVVVV/tree/localization-orig
This commit is contained in:
Dav999-v 2022-12-29 05:02:09 +01:00 committed by Misa Elizabeth Kai
parent f8fd51fc95
commit 72f030fd8e
2 changed files with 5 additions and 1 deletions

View file

@ -245,7 +245,8 @@ void vformat_cb_valist(
trim_whitespace(&arg_name, &arg_name_len);
trim_whitespace(&arg_type, &arg_type_len);
match = (arg_name_len == name_len && SDL_memcmp(arg_name, name, name_len) == 0);
match = (arg_name_len == name_len && SDL_memcmp(arg_name, name, name_len) == 0)
|| (arg_name_len == 1 && arg_name[0] == '_');
if (arg_type_len == 3 && SDL_memcmp(arg_type, "int", 3) == 0)
{

View file

@ -45,6 +45,9 @@
* - str const char*
* - but Controller button icon
*
* Special case: if an argument name is a single underscore (_), it matches
* any name not found earlier in the list. This should normally not be needed.
*
* Full example:
*
* char buffer[100];