Check auto generated backup names for invalid characters
Change name to date/time only if the auto generated backup name
contains any invalid characters.
Change-Id: I73e9e546373088ee7852fa31015060ce95a1d020
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 6c1f25f..bce65f0 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -1018,6 +1018,10 @@
space_check = Backup_Name.substr(Backup_Name.size() - 1, 1);
}
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());
+ DataManager::SetValue(TW_BACKUP_NAME, Get_Current_Date());
+ }
}
void TWFunc::Fixup_Time_On_Boot()