LibC: The pwd and grp related functions need to preserve empty fieldso

Now that String::split() defaults to keep_empty=false, we need to make
sure the pwd and grp functions in LibC keep the empty ones.

This fixes "id" moaning about invalid lines in /etc/group.
This commit is contained in:
Andreas Kling 2020-01-23 14:14:49 +01:00
parent 95504b5850
commit 4aa1b5b40e
2 changed files with 2 additions and 2 deletions

View file

@ -113,7 +113,7 @@ next_entry:
if (feof(__grdb_stream))
return nullptr;
String line(s, Chomp);
auto parts = line.split(':');
auto parts = line.split(':', true);
if (parts.size() != 4) {
fprintf(stderr, "getgrent(): Malformed entry on line %u: '%s' has %u parts\n", __grdb_line_number, line.characters(), parts.size());
goto next_entry;

View file

@ -114,7 +114,7 @@ next_entry:
if (feof(__pwdb_stream))
return nullptr;
String line(s, Chomp);
auto parts = line.split(':');
auto parts = line.split(':', true);
if (parts.size() != 7) {
fprintf(stderr, "getpwent(): Malformed entry on line %u\n", __pwdb_line_number);
goto next_entry;