mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 20:45:14 +00:00
Userland: Support comments and blank lines in /etc/fstab
This commit is contained in:
parent
93ff911473
commit
1a55264fe6
Notes:
sideshowbarker
2024-07-19 10:07:17 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/1a55264fe6f Pull-request: https://github.com/SerenityOS/serenity/pull/1063
1 changed files with 4 additions and 0 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Reference in a new issue