From 1a55264fe6f2cdb0eac515fb86d0d5b1a30fd218 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sun, 12 Jan 2020 19:29:17 +0300 Subject: [PATCH] Userland: Support comments and blank lines in /etc/fstab --- Userland/mount.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Userland/mount.cpp b/Userland/mount.cpp index 5ccd955b8d..3b66e5d60d 100644 --- a/Userland/mount.cpp +++ b/Userland/mount.cpp @@ -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 parts = line.split('\t'); if (parts.size() < 3) { fprintf(stderr, "Invalid fstab entry: %s\n", line.characters());