summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorVojtech Bocek <vbocek@gmail.com>2013-07-13 02:21:32 +0200
committerGerrit Code Review <gerrit@198.50.184.117>2013-08-24 14:52:45 +0200
commit00b260587cea0671801a34bf15840ea47b42ab39 (patch)
treea5900d9ce45f3ec3b535d3b40b25ee78ca6d96a1 /twrp-functions.cpp
parentAdd ability to run scripts after screen timeout/wake (diff)
downloadandroid_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar.gz
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar.bz2
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar.lz
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar.xz
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.tar.zst
android_bootable_recovery-00b260587cea0671801a34bf15840ea47b42ab39.zip
Diffstat (limited to '')
-rw-r--r--twrp-functions.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index d9014b364..29c70a52b 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -589,7 +589,8 @@ bool TWFunc::Fix_su_Perms(void) {
int TWFunc::tw_chmod(string fn, string mode) {
long mask = 0;
- for ( std::string::size_type n = 0; n < mode.length(); ++n) {
+ std::string::size_type n = (mode.length() == 3) ? 1 : 0;
+ for (; n < mode.length(); ++n) {
if (n == 0) {
if (mode[n] == '0')
continue;