summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'twrp-functions.cpp')
-rwxr-xr-xtwrp-functions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 28a0f0cc7..5b618e2ac 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -879,10 +879,11 @@ void TWFunc::Auto_Generate_Backup_Name() {
space_check = Backup_Name.substr(Backup_Name.size() - 1, 1);
}
replace(Backup_Name.begin(), Backup_Name.end(), ' ', '_');
- DataManager::SetValue(TW_BACKUP_NAME, Backup_Name);
- if (PartitionManager.Check_Backup_Name(false) != 0) {
- LOGINFO("Auto generated backup name '%s' contains invalid characters, using date instead.\n", Backup_Name.c_str());
+ if (PartitionManager.Check_Backup_Name(Backup_Name, false, true) != 0) {
+ LOGINFO("Auto generated backup name '%s' is not valid, using date instead.\n", Backup_Name.c_str());
DataManager::SetValue(TW_BACKUP_NAME, Get_Current_Date());
+ } else {
+ DataManager::SetValue(TW_BACKUP_NAME, Backup_Name);
}
}