diff options
author | Dees Troy <dees_troy@teamw.in> | 2013-10-23 21:10:15 +0200 |
---|---|---|
committer | Gerrit Code Review <gerrit2@build1> | 2013-10-23 21:10:15 +0200 |
commit | fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a (patch) | |
tree | 9cf5d0de064a1d1395a28da698a260bb3b99a0c8 | |
parent | Add conditions support to GUIImage (diff) | |
parent | Remove trailing spaces on auto generated backup names (diff) | |
download | android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar.gz android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar.bz2 android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar.lz android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar.xz android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.tar.zst android_bootable_recovery-fb9f7f3c7fb0a5d21c52390f47c1ce3e6f8ddf1a.zip |
-rw-r--r-- | twrp-functions.cpp | 7 |
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; } |