- if((iface&INPUT) && interfaces[from_scope-1])
- replacement = format("%c_%s", interfaces[from_scope-1], replacement);
+ VariableScope prev_scope = previous_scope(from_scope, enabled_scopes);
+ if((iface&INPUT) && interfaces[prev_scope])
+ replacement = format("%c_%s", interfaces[prev_scope], replacement);