Skip to content

Commit 6ee7170

Browse files
ptoscanoraphink
authored andcommitted
Fstab: allow leading whitespace in lines with spec (hercules-team#544)
The documentation does not explicitly mention this possibility, but tooling that parses fstab actually supports this: hence, allow leading whitespace in lines with filesystem specification.
1 parent e5ec4fd commit 6ee7170

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lenses/fstab.aug

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ module Fstab =
2323
Build.opt_list lns comma
2424

2525
let record = [ seq "mntent" .
26+
Util.indent .
2627
[ label "spec" . store spec ] . sep_tab .
2728
[ label "file" . store file ] . sep_tab .
2829
comma_sep_list "vfstype" .

lenses/tests/test_fstab.aug

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module Test_fstab =
1111
{ "dump" = "1" }
1212
{ "passno" = "1" } }
1313

14+
let leading_ws = " /dev/vg00/lv00\t /\t ext3\t defaults 1 1\n"
15+
1416
let trailing_ws = "/dev/vg00/lv00\t /\t ext3\t defaults 1 1 \t\n"
1517

1618
let gen_no_passno(passno:string) =
@@ -60,6 +62,8 @@ module Test_fstab =
6062

6163
test Fstab.lns get simple = simple_tree
6264

65+
test Fstab.lns get leading_ws = simple_tree
66+
6367
test Fstab.lns get trailing_ws = simple_tree
6468

6569
test Fstab.lns get no_passno = no_passno_tree

0 commit comments

Comments
 (0)