Add separator between mount flags in dump_flags

The previous code would concatenate all of them together without spacing.
While dump_flags and the corresponding operator<< function aren't currently used,
this will help for when dump_flags is used to debug parser problems.

Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
(cherry picked from commit 96718ea4d1)
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
Ryan Lee 2024-12-17 11:47:48 -08:00 committed by John Johansen
parent 164526d16a
commit d96d69a60c

View file

@ -313,11 +313,17 @@ static struct mnt_keyword_table mnt_conds_table[] = {
static ostream &dump_flags(ostream &os,
pair <unsigned int, unsigned int> flags)
{
bool is_first = true;
for (int i = 0; mnt_opts_table[i].keyword; i++) {
if ((flags.first & mnt_opts_table[i].set) ||
(flags.second & mnt_opts_table[i].clear))
(flags.second & mnt_opts_table[i].clear)) {
if (!is_first) {
os << ", ";
}
is_first = false;
os << mnt_opts_table[i].keyword;
}
}
return os;
}