Skip to content

Commit

Permalink
[Parsel] Force all package IDs to be lowercase
Browse files Browse the repository at this point in the history
Because they should be anyway...
  • Loading branch information
wstyres committed May 14, 2019
1 parent 3df962f commit 96277b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Zebra/Parsel/parsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "parsel.h"
#include "dict.h"
#include <ctype.h>

typedef char *multi_tok_t;

Expand Down Expand Up @@ -295,7 +296,10 @@ enum PARSEL_RETURN_TYPE importPackagesToDatabase(const char *path, sqlite3 *data
}
}
else if (dict_get(package, "Package") != 0) {
const char *packageIdentifier = dict_get(package, "Package");
char *packageIdentifier = (char *)dict_get(package, "Package");
for(int i = 0; packageIdentifier[i]; i++){
packageIdentifier[i] = tolower(packageIdentifier[i]);
}
const char *tags = dict_get(package, "Tag");
if (strcasestr(dict_get(package, "Status"), "not-installed") == NULL && strcasestr(dict_get(package, "Status"), "deinstall") == NULL) {
if (tags != NULL && strcasestr(tags, "role::cydia") != NULL) {
Expand Down Expand Up @@ -392,7 +396,10 @@ enum PARSEL_RETURN_TYPE updatePackagesInDatabase(const char *path, sqlite3 *data
}
}
else if (dict_get(package, "Package") != 0) {
const char *packageIdentifier = dict_get(package, "Package");
char *packageIdentifier = (char *)dict_get(package, "Package");
for(int i = 0; packageIdentifier[i]; i++){
packageIdentifier[i] = tolower(packageIdentifier[i]);
}
const char *tags = dict_get(package, "Tag");
if (tags != NULL && strcasestr(tags, "role::cydia") != NULL) {
repoID = -1;
Expand Down

0 comments on commit 96277b2

Please sign in to comment.