1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 07:31:15 +02:00

== operator: Ignore string context

There really is no case I can think of where taking the context into
account is useful. Mostly it's just very inconvenient.
This commit is contained in:
Eelco Dolstra 2014-06-10 14:02:56 +02:00
parent b1beed97a0
commit ee7fe64c0a
3 changed files with 4 additions and 13 deletions

View file

@ -1355,17 +1355,8 @@ bool EvalState::eqValues(Value & v1, Value & v2)
case tBool:
return v1.boolean == v2.boolean;
case tString: {
/* Compare both the string and its context. */
if (strcmp(v1.string.s, v2.string.s) != 0) return false;
const char * * p = v1.string.context, * * q = v2.string.context;
if (!p && !q) return true;
if (!p || !q) return false;
for ( ; *p && *q; ++p, ++q)
if (strcmp(*p, *q) != 0) return false;
if (*p || *q) return false;
return true;
}
case tString:
return strcmp(v1.string.s, v2.string.s) == 0;
case tPath:
return strcmp(v1.path, v2.path) == 0;