[augeas-devel] augeas: master - * src/pathx.c: make sure ['foo' != 'foo'] is false

David Lutterkort lutter at fedoraproject.org
Tue Mar 3 23:49:32 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=bfe4ac42e2397a4ccc2e124a59bbd5ce38ecec3c
Commit:        bfe4ac42e2397a4ccc2e124a59bbd5ce38ecec3c
Parent:        4e34ef9b3d0bd8c97d86e86bbba11d49f79e8a82
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Mon Mar 2 14:29:17 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Mon Mar 2 14:29:17 2009 -0800

* src/pathx.c: make sure ['foo' != 'foo'] is false

---
 src/pathx.c       |    2 ++
 tests/xpath.tests |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/pathx.c b/src/pathx.c
index 6a4d723..15a51b6 100644
--- a/src/pathx.c
+++ b/src/pathx.c
@@ -523,6 +523,8 @@ static void eval_eq(struct state *state, int neq) {
         assert(l->tag == T_STRING);
         assert(r->tag == T_STRING);
         res = streqx(l->string, r->string);
+        if (neq)
+            res = !res;
     }
     CHECK_ERROR;
 
diff --git a/tests/xpath.tests b/tests/xpath.tests
index 0fa1e3d..b5eeb67 100644
--- a/tests/xpath.tests
+++ b/tests/xpath.tests
@@ -165,3 +165,5 @@ test pred-and-or /files/etc/hosts/*[(canonical = 'localhost' or alias = 'localho
 # was silently ignored. This path must not match anything, instead of
 # every child of /files/etc
 test path-with-dot /files/etc/.notthere
+
+test str-neq /files/etc/*['foo' != 'foo']




More information about the augeas-devel mailing list