Skip to content

Commit

Permalink
only protect usage of # if it's the first character
Browse files Browse the repository at this point in the history
  • Loading branch information
FoofooTheGuy authored Dec 25, 2022
1 parent af5555a commit 2b6c949
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions VidInjector9001/src/VidInjector9001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -851,6 +851,21 @@ void Movie_title() {
if(tolowerstr((std::string)&name[name.size()-4]) == ".txt" || tolowerstr((std::string)&name[name.size()-5]) == ".txt\"") {
if(readTxt(name, name)) utf16 = true;
}
if(name[0] == '#') {
std::string choiche = "";
while(choiche == "") {
puts("WARNING: Character #%1 ('#') in the title will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]");
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
name[0] = '\\';
name.insert(1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
for(unsigned long long i = 0; i < name.size(); i++) {
if(name[i] == ',') {
std::string choiche = "";
Expand All @@ -867,21 +882,6 @@ void Movie_title() {
}
}
}
else if(name[i] == '#') {
std::string choiche = "";
while(choiche == "") {
printf("WARNING: Character #%lld ('#') in the title will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]\n", i+1);
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
name[i] = '\\';
name.insert(i+1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
}
for (int j = 0; j < 11; j++) {//do it 11 times because it needs to
if(utf16) movie_title << name + UTF8toUTF16(",");
Expand Down Expand Up @@ -928,6 +928,21 @@ void makesettingsTL() {
if(tolowerstr((std::string)&name[name.size()-4]) == ".txt" || tolowerstr((std::string)&name[name.size()-5]) == ".txt\"") {
if(readTxt(name, name)) utf16 = true;
}
if(name[0] == '#') {
std::string choiche = "";
while(choiche == "") {
puts("WARNING: Character #%1 ('#') in the name will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]");
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
name[0] = '\\';
name.insert(1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
for(unsigned long long i = 0; i < name.size(); i++) {
if(name[i] == ',') {
std::string choiche = "";
Expand All @@ -944,21 +959,6 @@ void makesettingsTL() {
}
}
}
else if(name[i] == '#') {
std::string choiche = "";
while(choiche == "") {
printf("WARNING: Character #%lld ('#') in the name will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]\n", i+1);
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
name[i] = '\\';
name.insert(i+1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
}
cls

Expand Down Expand Up @@ -1107,6 +1107,21 @@ void makesettingsTL() {
if(tolowerstr((std::string)&publisher[publisher.size()-4]) == ".txt" || tolowerstr((std::string)&publisher[publisher.size()-5]) == ".txt\"") {
if(readTxt(publisher, publisher)) utf16 = true;
}
if(publisher[0] == '#') {
std::string choiche = "";
while(choiche == "") {
puts("WARNING: Character #1 ('#') in the name will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]");
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
publisher[0] = '\\';
publisher.insert(1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
for(unsigned long long i = 0; i < publisher.size(); i++) {
if(publisher[i] == ',') {
std::string choiche = "";
Expand All @@ -1123,21 +1138,6 @@ void makesettingsTL() {
}
}
}
else if(publisher[i] == '#') {
std::string choiche = "";
while(choiche == "") {
printf("WARNING: Character #%lld ('#') in the name will be a problem.\nReplace it with \"\\x23\" to have a number sign in the title? [Y/N]\n", i+1);
std::getline(std::cin, choiche);
if(tolower(choiche[0]) == 'y') {
publisher[i] = '\\';
publisher.insert(i+1, "x23");
}
else if(tolower(choiche[0]) != 'n') {
choiche = "";
cls
}
}
}
}
settingsTL << UTF8toUTF16("\x0D\x0A"
"# 動画の数\x0D\x0A"//amount of videos
Expand Down

0 comments on commit 2b6c949

Please sign in to comment.