+2007-01-22 Martin Hunt <hunt@redhat.com>
+
+ * translate.cxx (mapvar::exists): Use new _stp_map_exists function.
+ Testing for zero is no longer correct after changes from 2007-01-10
+ below.
+
2007-01-18 Frank Ch. Eigler <fche@elastic.org>
* main.cxx (version): Add (C) 2007.
string exists (vector<tmpvar> const & indices) const
{
- if (type() == pe_string)
- return ("({ char *v = " + call_prefix("get", indices)
- + "); (v != NULL && *v != '\\0');})");
- else if ((type() == pe_long) || (type() == pe_stats))
+ if (type() == pe_long || type() == pe_string)
+ return (call_prefix("exists", indices) + ")");
+ else if (type() == pe_stats)
return ("((uintptr_t)" + call_prefix("get", indices)
+ ") != (uintptr_t) 0)");
else