diff options
Diffstat (limited to 'misc/tst-mntent.c')
-rw-r--r-- | misc/tst-mntent.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/misc/tst-mntent.c b/misc/tst-mntent.c index 802b56e437..876c89f8ed 100644 --- a/misc/tst-mntent.c +++ b/misc/tst-mntent.c @@ -73,7 +73,27 @@ main (int argc, char *argv[]) puts ("Error while reading written entry back in"); result = 1; } - } + + /* Part III: Entry with whitespaces at the end of a line. */ + rewind (fp); + + fputs ("/foo\\040dir /bar\\040dir auto bind \t \n", fp); + + rewind (fp); + + mnt = getmntent (fp); + + if (strcmp (mnt->mnt_fsname, "/foo dir") != 0 + || strcmp (mnt->mnt_dir, "/bar dir") != 0 + || strcmp (mnt->mnt_type, "auto") != 0 + || strcmp (mnt->mnt_opts, "bind") != 0 + || mnt->mnt_freq != 0 + || mnt->mnt_passno != 0) + { + puts ("Error while reading entry with trailing whitespaces"); + result = 1; + } + } return result; } |