From: Daniel Lezcano Date: Fri, 13 May 2011 20:29:34 +0000 (+0200) Subject: ignore non-lxc configuration line X-Git-Tag: lxc-0.7.5~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=476d4cf1750fa9a43304ee7cd175e3298dc2faa8;p=thirdparty%2Flxc.git ignore non-lxc configuration line We ignore the line of in the configuration file not beginning by "lxc." So we can mix the configuration file with another information used for another component through the lxc library. Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 791f04f3d..d632404b1 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -799,7 +799,7 @@ static int parse_line(char *buffer, void *data) char *dot; char *key; char *value; - int ret = -1; + int ret = 0; if (lxc_is_line_empty(buffer)) return 0; @@ -815,10 +815,14 @@ static int parse_line(char *buffer, void *data) } line += lxc_char_left_gc(line, strlen(line)); - if (line[0] == '#') { - ret = 0; + + /* martian option - ignoring it, the commented lines beginning by '#' + * fall in this case + */ + if (strncmp(line, "lxc.", 4)) goto out; - } + + ret = -1; dot = strstr(line, "="); if (!dot) {