Permalink
Browse files

implemented: Augeas::match() should return assoc array with nodes => …

…values
  • Loading branch information...
1 parent 441ac6a commit d68d428efb65ac124f96711c32d693147439a276 @ppadron committed Dec 3, 2009
Showing with 9 additions and 2 deletions.
  1. +9 −2 augeas.c
View
@@ -320,7 +320,7 @@ PHP_METHOD(Augeas, match)
{
int i;
char *path;
- char *value;
+ char *value, *tmpval;
char **matches;
augeas *aug_intern;
@@ -343,7 +343,14 @@ PHP_METHOD(Augeas, match)
if (retval > 0) {
for (i=0; i<retval; i++) {
- add_next_index_string(return_value, matches[i], 1);
+
+ aug_get(aug_intern, matches[i], &tmpval);
+
+ if (tmpval) {
+ add_assoc_string(return_value, matches[i], tmpval, 1);
+ } else {
+ add_assoc_null(return_value, matches[i]);
+ }
}
}

0 comments on commit d68d428

Please sign in to comment.