[augeas-devel] [PATCH 1/9] * src/augeas.c (aug_defvar): use constants to create /augeas/variables

lutter at redhat.com lutter at redhat.com
Wed Jun 30 00:52:14 UTC 2010


From: David Lutterkort <lutter at redhat.com>

---
 src/augeas.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/augeas.c b/src/augeas.c
index c21afe9..7b51a77 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -41,6 +41,7 @@ static const char *const s_load   = "load";
 static const char *const s_pathx  = "pathx";
 static const char *const s_error  = "error";
 static const char *const s_pos    = "pos";
+static const char *const s_vars   = "variables";
 
 #define TREE_HIDDEN(tree) ((tree)->label == NULL)
 
@@ -529,7 +530,7 @@ int aug_defvar(augeas *aug, const char *name, const char *expr) {
     ERR_BAIL(aug);
 
     /* Record the definition of the variable */
-    struct tree *tree = tree_path_cr(aug->origin, 2, "augeas", "variables");
+    struct tree *tree = tree_path_cr(aug->origin, 2, s_augeas, s_vars);
     ERR_NOMEM(tree == NULL, aug);
     if (expr == NULL) {
         tree = tree_child(tree, name);
-- 
1.6.6.1




More information about the augeas-devel mailing list