minor var minimize fixes

~ OPTING and OPTARG reserved
+ Add command read to variable argument parse
This commit is contained in:
zawz 2020-11-06 17:07:18 +01:00
parent c971b4e424
commit a777608f08
2 changed files with 2 additions and 2 deletions

View file

@ -9,7 +9,7 @@
extern std::regex re_var_exclude;
extern std::regex re_fct_exclude;
#define RESERVED_VARIABLES "HOME", "PATH", "SHELL", "PWD"
#define RESERVED_VARIABLES "HOME", "PATH", "SHELL", "PWD", "OPTIND", "OPTARG"
std::regex var_exclude_regex(std::string const& in);
std::regex fct_exclude_regex(std::string const& in);

View file

@ -50,7 +50,7 @@ std::vector<subarg*> cmd::arg_vars()
return ret;
std::string cmdname=this->firstarg_string();
if(cmdname == "export" || cmdname == "unset" || cmdname == "local")
if(cmdname == "export" || cmdname == "unset" || cmdname == "local" || cmdname == "read")
{
for(uint32_t i=1; i<args->size(); i++)
{