Fixed issue #42 handling empty values

This commit is contained in:
Mattias
2022-09-10 16:01:04 +02:00
parent 0cbd909d5c
commit aef7d92a93
+5 -2
View File
@@ -557,10 +557,13 @@ ini_t* ini_load( char const* data, void* memctx )
start2 = ptr;
while( *ptr && *ptr != '\n' )
++ptr;
while( *(--ptr) <= ' ' )
while( ptr >= start2 && *(--ptr) <= ' ' )
(void)ptr;
ptr++;
ini_property_add( ini, s, start, l, start2, (int)( ptr - start2) );
if( ptr == start2 )
ini_property_add( ini, s, start, l, "", 1 );
else
ini_property_add( ini, s, start, l, start2, (int)( ptr - start2 ) );
}
}
}