From: Yuto KAWAMURA(kawamuray) Date: Fri, 4 Jul 2014 17:40:02 +0000 (+0900) Subject: Change find_fstype_cb to ignore blank lines and comments X-Git-Tag: lxc-1.1.0.alpha1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9827ecdb6d07981fefbd0af570c782c322ff8e0b;p=thirdparty%2Flxc.git Change find_fstype_cb to ignore blank lines and comments /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) Acked-by: Serge E. Hallyn --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 66108bb6b..052db9841 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -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);