diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-08 10:39:16 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:24 -0500 |
commit | aa37e5483b5f86d8b8c6a803acf5bb68f37ae022 (patch) | |
tree | 807283b6ef48aa32df06d736f478745c0b83b9e6 | |
parent | 78b3ea6c26266ffd095c07aefc94338bb83a700b (diff) | |
download | samba-aa37e5483b5f86d8b8c6a803acf5bb68f37ae022.tar.gz samba-aa37e5483b5f86d8b8c6a803acf5bb68f37ae022.tar.bz2 samba-aa37e5483b5f86d8b8c6a803acf5bb68f37ae022.zip |
r8240: support comparing pointers in ejs. This allows for
if (io.output.samr == NULL) {
print("no result\n");
}
(This used to be commit 89db5c68a5ee6875ccddcfe70a6e1232b40039b3)
-rw-r--r-- | source4/lib/ejs/ejsParser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source4/lib/ejs/ejsParser.c b/source4/lib/ejs/ejsParser.c index 8d0aa7ba2c..57cb569cdb 100644 --- a/source4/lib/ejs/ejsParser.c +++ b/source4/lib/ejs/ejsParser.c @@ -1659,10 +1659,13 @@ static int evalExpr(Ejs *ep, MprVar *lhs, int rel, MprVar *rhs) case MPR_TYPE_CFUNCTION: case MPR_TYPE_FUNCTION: case MPR_TYPE_OBJECT: - case MPR_TYPE_PTR: mprCopyVarValue(&ep->result, mprCreateBoolVar(0), 0); return 0; + case MPR_TYPE_PTR: + mprCopyVarValue(&ep->result, mprCreateBoolVar(lhs->ptr == rhs->ptr), 0); + return 0; + case MPR_TYPE_BOOL: rc = evalBoolExpr(ep, lhs->boolean, rel, rhs->boolean); break; |