Skip to content

Commit

Permalink
Added code for !key,* = DEL and fixed group nr. 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas committed Jan 1, 2016
1 parent f32b316 commit 37c7595
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions moduleManager.cs
Expand Up @@ -1556,7 +1556,7 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
{
if (match.Groups[2].Success)
log("Error - Cannot use index with replace (%) value: " + mod.name);
if (match.Groups[3].Success)
if (match.Groups[5].Success)
log("Error - Cannot use operators with replace (%) value: " + mod.name);
if (valName.Contains('*') || valName.Contains('?'))
log("Error - Cannot use wildcards (* or ?) with replace (%) value: " + mod.name);
Expand Down Expand Up @@ -1618,17 +1618,22 @@ public ConfigNode ModifyNode(ConfigNode original, ConfigNode mod)
break;

case Command.Delete:
if (match.Groups[3].Success)
if (match.Groups[5].Success)
{
log("Error - Cannot use operators with delete (- or !) value: " + mod.name);
errorCount++;
}
else if (match.Groups[2].Success)
{
// If there is an index, use it.
ConfigNode.Value v = FindValueIn(newNode, valName, index);
if (v != null)
newNode.values.Remove(v);
while (index < newNode.values.Count)
{
// If there is an index, use it.
ConfigNode.Value v = FindValueIn(newNode, valName, index);
if (v != null)
newNode.values.Remove(v);
if (isStar) index++;
else break;
}
}
else if (valName.Contains('*') || valName.Contains('?'))
{
Expand Down

0 comments on commit 37c7595

Please sign in to comment.