set: Use env_var_t::flags_for() to see if it's read-only
env_var_t::read_only() is basically broken. It doesn't work for $PWD, as best as I can tell no variable is read-only except for a hardcoded list of some of the electric ones. So we should probably remove the entire read_only and setting_read_only mechanism.
This commit is contained in:
parent
09b8471f5c
commit
55732f445a
@ -514,7 +514,7 @@ static void show_scope(const wchar_t *var_name, int scope, io_streams_t &streams
|
||||
scope_name, exportv, pathvarv, vals.size());
|
||||
// HACK: PWD can be set, depending on how you ask.
|
||||
// For our purposes it's read-only.
|
||||
if (var->read_only() || wcscmp(var_name, L"PWD") == 0) {
|
||||
if (env_var_t::flags_for(var_name) & env_var_t::flag_read_only) {
|
||||
streams.out.append(_(L"Variable is read-only\n"));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user