Skip to content

Commit

Permalink
Change find_fstype_cb to ignore blank lines and comments
Browse files Browse the repository at this point in the history
/etc/filesystems could be contain blank lines and comments.
Change find_fstype_cb() to ignore blank lines and comments which starts
with '#'.

Signed-off-by: Yuto KAWAMURA(kawamuray) <kawamuray.dadada@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
kawamuray authored and stgraber committed Jul 7, 2014
1 parent 6000d5b commit 9827ecd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lxc/conf.c
Expand Up @@ -447,6 +447,10 @@ static int find_fstype_cb(char* buffer, void *data)
fstype += lxc_char_left_gc(fstype, strlen(fstype));
fstype[lxc_char_right_gc(fstype, strlen(fstype))] = '\0';

/* ignore blank line and comment */
if (fstype[0] == '\0' || fstype[0] == '#')
return 0;

DEBUG("trying to mount '%s'->'%s' with fstype '%s'",
cbarg->rootfs, cbarg->target, fstype);

Expand Down

0 comments on commit 9827ecd

Please sign in to comment.