mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05: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:
parent
95504b5850
commit
4aa1b5b40e
2 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue