summaryrefslogtreecommitdiff
path: root/Libraries/LibC/grp.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-01-23 14:14:49 +0100
committerAndreas Kling <kling@serenityos.org>2020-01-23 14:33:58 +0100
commit4aa1b5b40e14b6173d576fa22563ebd393561296 (patch)
tree7ffc8a24b72bfef4fc6c306df656f73ab24f6c63 /Libraries/LibC/grp.cpp
parent95504b5850300e77fff3ef5654bf6cce91c63f29 (diff)
downloadserenity-4aa1b5b40e14b6173d576fa22563ebd393561296.zip
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.
Diffstat (limited to 'Libraries/LibC/grp.cpp')
-rw-r--r--Libraries/LibC/grp.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibC/grp.cpp b/Libraries/LibC/grp.cpp
index c00f38897d..21d4a73650 100644
--- a/Libraries/LibC/grp.cpp
+++ b/Libraries/LibC/grp.cpp
@@ -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;