Version 0.0.1 fixing issues.

This commit is contained in:
unrealdragon 2026-05-14 17:06:59 +05:30
commit cc12b4765c

View file

@ -178,7 +178,7 @@ void parseArgs(int c, char *v[]) {
int i = contains(arg_list, "--json", "-j");
if(i >= 0) {
int j = i + 1;
if(j > c) {
if(j > arg_list.size()) {
printHelp();
exit(-1);
}
@ -189,7 +189,7 @@ void parseArgs(int c, char *v[]) {
i = contains(arg_list, "--log_dir", "-ld");
if(i >= 0) {
int j = i + 1;
if(j > c) {
if(j > arg_list.size()) {
printHelp();
exit(-1);
}
@ -200,7 +200,7 @@ void parseArgs(int c, char *v[]) {
i = contains(arg_list, "--threads", "-t");
if(i >= 0) {
int j = i + 1;
if(j > c) {
if(j > arg_list.size()) {
printHelp();
exit(-1);
}
@ -211,7 +211,7 @@ void parseArgs(int c, char *v[]) {
i = contains(arg_list, "--help", "-h");
if(i >= 0) {
int j = i + 1;
if(j > c) {
if(j > arg_list.size()) {
printHelp();
exit(-1);
}
@ -237,7 +237,7 @@ std::string string_strip(std::string str) {
bool front_found = false;
for(int i=0; i<str.size(); i++) {
if(!front_found) {
if(str[i] == ' ' || str[i] == '\t' || str[i] == '\n' || str[i] == '\v')
if(str[i] == ' ' || str[i] == '\t' || str[i] == '\n' || str[i] == '\v' || str[i] == '\r')
continue;
else {
front_found = true;
@ -248,7 +248,7 @@ std::string string_strip(std::string str) {
else
ch += str[i];
}
auto pos = ch.find_last_not_of(" ");
auto pos = ch.find_last_not_of(" \t\n\v\r");
if(pos == std::string::npos)
return ch;
ch.erase(pos+1);
@ -321,8 +321,8 @@ std::optional<int> checkAppList(std::deque<AppInfo::AppData> &copy_list, std::ve
int reshuffle_count = 0;
while(copy_list.size() != 0) {
size_t copy_list_size = copy_list.size();
for(auto item = copy_list.begin(); item != copy_list.end(); item++) {
if(item->getAfterString().size() == 0) {
for(auto item = copy_list.begin(); item != copy_list.end();) {
if(item->after.size() == 0) {
std::shared_ptr<AppInfo> app_info = std::make_shared<AppInfo>();
app_info->copyFromData(*item);
after_list.push_back(std::move(app_info));
@ -364,6 +364,9 @@ std::optional<int> checkAppList(std::deque<AppInfo::AppData> &copy_list, std::ve
reshuffle_count = 0;
item = copy_list.erase(item);
}
else {
item++;
}
if(copy_list.size() == 0 || item == copy_list.end())
break;
}