summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbigbiff <bigbiff@teamw.in>2015-02-15 02:49:44 +0100
committerDees Troy <dees_troy@teamw.in>2015-02-21 15:24:49 +0100
commit74a6d0d56203fd0d1eebe4fc9bb432f8504e0253 (patch)
tree06cac3276a5d6e2afef1023e255b2d5971b9fea7
parentGUI: Support styles in xml to reduce xml file size (diff)
downloadandroid_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar.gz
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar.bz2
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar.lz
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar.xz
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.tar.zst
android_bootable_recovery-74a6d0d56203fd0d1eebe4fc9bb432f8504e0253.zip
-rw-r--r--twrp-functions.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 55f795c6f..e6961e288 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -35,6 +35,7 @@
#include <iostream>
#include <fstream>
#include <sstream>
+#include <algorithm>
#include "twrp-functions.hpp"
#include "twcommon.h"
#ifndef BUILD_TWRPTAR_MAIN
@@ -814,7 +815,7 @@ void TWFunc::Auto_Generate_Backup_Name() {
return;
}
string Backup_Name = Get_Current_Date();
- Backup_Name += " " + propvalue;
+ Backup_Name += "_" + propvalue;
if (Backup_Name.size() > MAX_BACKUP_NAME_LEN)
Backup_Name.resize(MAX_BACKUP_NAME_LEN);
// Trailing spaces cause problems on some file systems, so remove them
@@ -824,6 +825,7 @@ void TWFunc::Auto_Generate_Backup_Name() {
Backup_Name.resize(Backup_Name.size() - 1);
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());