Skip to content

Commit

Permalink
Automatically decompress ZSTD file from -b
Browse files Browse the repository at this point in the history
Makes -b functions automatically decompress when using ZSTD files

Signed-off-by Christopher Wu<christopher.wu@nxp.com>
  • Loading branch information
chriswu86459 committed Jun 22, 2022
1 parent e6e5f70 commit 70d1e85
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions uuu/buildincmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,19 +250,33 @@ void BuiltInScriptMap::ShowCmds(FILE * const file) const
*/
static std::string replace_str(std::string str, std::string key, std::string replace)
{
std::string s5, s4;
std::string match[] = { ".BZ2", ".ZST" };
if (replace.size() > 4)
{
if (replace[replace.size() - 1] == '\"')
{
if (str_to_upper(replace.substr(replace.size() - 5)) == ".BZ2\"")
s5 = str_to_upper(replace.substr(replace.size() - 5));
for (std::string it : match)
{
replace = replace.substr(0, replace.size() - 1);
replace += "/*\"";
if (s5 == it)
{
replace = replace.substr(0, replace.size() - 1);
replace += "/*\"";
}
}

}else if (str_to_upper(replace.substr(replace.size() - 4)) == ".BZ2")
}
else
{
replace += "/*";
s4 = str_to_upper(replace.substr(replace.size() - 4));
for (std::string it : match)
{
if (it == s4)
{
replace += "/*";
}
}
}
}

Expand Down

0 comments on commit 70d1e85

Please sign in to comment.