mirror of
https://github.com/mattiasgustavsson/libs.git
synced 2026-11-30 16:48:22 +01:00
Fixed issue #42 handling empty values
This commit is contained in:
@@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user