mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-27 07:15:37 +03:00
Allow value be empty in lang files (#431)
* Allow value be empty in lang files * Refactor solution.
This commit is contained in:
parent
123246cc84
commit
e9f501c250
@ -393,7 +393,7 @@ bool CLangMngr::ReadINI_KeyValue(const char *key, const char *value, bool invali
|
|||||||
{
|
{
|
||||||
Data.lastKey = key;
|
Data.lastKey = key;
|
||||||
|
|
||||||
if (colons_token || (equal_token && value))
|
if (colons_token || equal_token)
|
||||||
{
|
{
|
||||||
int iKey = GetKeyEntry(key);
|
int iKey = GetKeyEntry(key);
|
||||||
|
|
||||||
@ -404,6 +404,9 @@ bool CLangMngr::ReadINI_KeyValue(const char *key, const char *value, bool invali
|
|||||||
|
|
||||||
if (equal_token)
|
if (equal_token)
|
||||||
{
|
{
|
||||||
|
if(value == nullptr) // Support empty value
|
||||||
|
Data.valueBuffer[0] = '\0';
|
||||||
|
else
|
||||||
strncopy(Data.valueBuffer, value, sizeof(Data.valueBuffer));
|
strncopy(Data.valueBuffer, value, sizeof(Data.valueBuffer));
|
||||||
|
|
||||||
reparse_newlines_and_color(Data.valueBuffer);
|
reparse_newlines_and_color(Data.valueBuffer);
|
||||||
|
Loading…
Reference in New Issue
Block a user