summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDees Troy <dees_troy@teamw.in>2013-10-17 02:26:23 +0200
committerDees Troy <dees_troy@teamw.in>2013-10-17 02:26:34 +0200
commita829d5deb2764a0f11bd21f84a45d2f5d12aff15 (patch)
treebdfbb7ccb40a27ba696bb0f14eb1f7be7d1f4aab
parentMerge "check for space after = too" into twrp2.7 (diff)
downloadandroid_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar.gz
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar.bz2
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar.lz
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar.xz
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.tar.zst
android_bootable_recovery-a829d5deb2764a0f11bd21f84a45d2f5d12aff15.zip
-rw-r--r--twrp-functions.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index c39a6b242..1c0ad7590 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -1016,6 +1016,13 @@ void TWFunc::Auto_Generate_Backup_Name() {
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
+ string space_check, space = " ";
+ space_check = Backup_Name.substr(Backup_Name.size() - 1, 1);
+ while (space_check == space) {
+ Backup_Name.resize(Backup_Name.size() - 1);
+ space_check = Backup_Name.substr(Backup_Name.size() - 1, 1);
+ }
DataManager::SetValue(TW_BACKUP_NAME, Backup_Name);
break;
}