implement missing operator replacements in debashify [[
This commit is contained in:
parent
b56e7d09f9
commit
53d8ce01ce
1 changed files with 17 additions and 3 deletions
|
|
@ -20,10 +20,24 @@ block* gen_bashtest_cmd(std::vector<arg*> args)
|
|||
{
|
||||
block* ret = nullptr;
|
||||
|
||||
if(args.size() == 3 && args[1]->string() == "==")
|
||||
std::string arg1replace;
|
||||
if(args.size() == 3)
|
||||
{
|
||||
delete args[1]->sa[0];
|
||||
args[1]->sa[0] = new string_subarg("=");
|
||||
if(args[1]->string() == "==")
|
||||
arg1replace="=";
|
||||
else if(args[1]->string() == "<")
|
||||
arg1replace="-lt";
|
||||
else if(args[1]->string() == "<=")
|
||||
arg1replace="-le";
|
||||
else if(args[1]->string() == ">")
|
||||
arg1replace="-gt";
|
||||
else if(args[1]->string() == ">=")
|
||||
arg1replace="-ge";
|
||||
}
|
||||
if(arg1replace != "")
|
||||
{
|
||||
delete args[1];
|
||||
args[1] = new arg(arg1replace);
|
||||
}
|
||||
|
||||
if(args.size() == 3 && args[1]->string() == "=" && arg_has_char('*', args[2]))
|
||||
|
|
|
|||
Loading…
Reference in a new issue