diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-19 22:00:50 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-05-19 22:17:45 +0300 |
commit | bcab0df28d7e87f99da29a32327787c25261273e (patch) | |
tree | 1dd18f5394afdd0584947cc502c5d2050ba721ba /src/format.c | |
parent | 304935a296997c9781688f08693ef70180dd24e4 (diff) | |
download | grecs-bcab0df28d7e87f99da29a32327787c25261273e.tar.gz grecs-bcab0df28d7e87f99da29a32327787c25261273e.tar.bz2 |
Implement "path-style" (Xres-style) config parser.
* src/path-parser.c: New file.
* src/format.c (grecs_format_node): Attempt to print value only
if the node is grecs_node_stmt.
* src/grecs.h (grecs_path_parser): New proto.
(grecs_node_from_path_locus): New proto.
* src/lookup.c (grecs_node_from_path_locus): New function.
* src/Make.am (GRECS_SRC): Add path-parser.c.
* build-aux/getopt.m4: Implement print_help_hook.
Diffstat (limited to 'src/format.c')
-rw-r--r-- | src/format.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/format.c b/src/format.c index 9e88412..6d87aed 100644 --- a/src/format.c +++ b/src/format.c @@ -302,7 +302,8 @@ grecs_format_node(struct grecs_node *node, int flags, grecs_format_node_path(node, flags, clos); delim_str = ": "; } - if (flags & GRECS_NODE_FLAG_VALUE) { + if (node->type == grecs_node_stmt && + (flags & GRECS_NODE_FLAG_VALUE)) { if (delim_str) clos->fmtfun(delim_str, clos->data); grecs_format_value(node->v.value, flags, clos); |