.Ar host Ns Li . Ns Ar variable .
.It add Ar variable Ar value
As above, but without removing any previously existing configuration variables.
+If the variable already exists with the given value, nothing happens.
.It del Ar variable Op Ar value
Remove configuration variables with the same name and
.Ar value .
@cindex add
@item add @var{variable} @var{value}
As above, but without removing any previously existing configuration variables.
+If the variable already exists with the given value, nothing happens.
@cindex del
@item del @var{variable} [@var{value}]
}
set = true;
continue;
+ // Add
+ } else if(action > 0) {
+ // Check if we've already seen this variable with the same value
+ if(!strcasecmp(bvalue, value))
+ found = true;
}
}
}
// Add new variable if necessary.
- if(action > 0 || (action == 0 && !set)) {
+ if((action > 0 && !found)|| (action == 0 && !set)) {
if(fprintf(tf, "%s = %s\n", variable, value) < 0) {
fprintf(stderr, "Error writing to temporary file %s: %s\n", tmpfile, strerror(errno));
return 1;