Fix TWFunc::tw_chmod() for 3-character mode string

This commit is contained in:
Vojtech Bocek
2013-07-13 02:21:32 +02:00
committed by Gerrit Code Review
parent 1c8d4fb0ea
commit 00b260587c
+2 -1
View File
@@ -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;