Skip to content

Commit

Permalink
Added pattern %region%
Browse files Browse the repository at this point in the history
- Added pattern %region% (first two characters of the Content ID) as requested in #3.
- Fixed a bug that happened when using tag files that contain empty lines.
  • Loading branch information
hippie68 authored Jul 20, 2022
1 parent 08cc829 commit ac6c73c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgrename.c/pkgrename.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ void pkgrename(char *filename) {
char *game = NULL;
char *other = NULL;
char *patch = NULL;
char region[3] = "";
char *release_group = NULL;
char *release = NULL;
char sdk[6] = "";
Expand Down Expand Up @@ -181,6 +182,9 @@ void pkgrename(char *filename) {
}
} else if (strcmp(params[i].name, "CONTENT_ID") == 0) {
content_id = params[i].string;
region[0] = content_id[0];
region[1] = content_id[1];
region[2] = '\0';
} else if (strcmp(params[i].name, "PUBTOOLINFO") == 0) {
char *p = strstr(params[i].string, "sdk_ver=");
if (p != NULL) {
Expand Down Expand Up @@ -277,6 +281,7 @@ void pkgrename(char *filename) {
strreplace(new_basename, "%backport%", backport);
strreplace(new_basename, "%category%", category);
strreplace(new_basename, "%content_id%", content_id);
strreplace(new_basename, "%region%", region);
strreplace(new_basename, "%firmware%", firmware);
if (tag_release_group[0] != '\0') {
strreplace(new_basename, "%release_group%", tag_release_group);
Expand Down

0 comments on commit ac6c73c

Please sign in to comment.