1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:47:44 +00:00

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;