Userland: Support comments and blank lines in /etc/fstab

This commit is contained in:
Sergey Bugaev 2020-01-12 19:29:17 +03:00 committed by Andreas Kling
parent 93ff911473
commit 1a55264fe6
Notes: sideshowbarker 2024-07-19 10:07:17 +09:00

View file

@ -48,6 +48,10 @@ bool mount_all()
line_view = line_view.substring_view(0, line_view.length() - 1);
String line = line_view;
// Skip comments and blank lines.
if (line.is_empty() || line.starts_with("#"))
continue;
Vector<String> parts = line.split('\t');
if (parts.size() < 3) {
fprintf(stderr, "Invalid fstab entry: %s\n", line.characters());