Fossil SCM
When setting execute permission only set it for those levels that also have read permission.
Commit
fd6f1c5e619fc297da692db468c839c33efec983
Parent
37c231b11d02739…
2 files changed
+3
-2
+3
-2
+3
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -199,12 +199,13 @@ | ||
| 199 | 199 | int rc = 0; |
| 200 | 200 | #if !defined(_WIN32) |
| 201 | 201 | struct stat buf; |
| 202 | 202 | if( stat(zFilename, &buf)!=0 ) return 0; |
| 203 | 203 | if( onoff ){ |
| 204 | - if( (buf.st_mode & 0111)!=0111 ){ | |
| 205 | - chmod(zFilename, buf.st_mode | 0111); | |
| 204 | + int targetMode = (buf.st_mode & 0444)>>2; | |
| 205 | + if( (buf.st_mode & 0111)!=targetMode ){ | |
| 206 | + chmod(zFilename, buf.st_mode | targetMode); | |
| 206 | 207 | rc = 1; |
| 207 | 208 | } |
| 208 | 209 | }else{ |
| 209 | 210 | if( (buf.st_mode & 0111)!=0 ){ |
| 210 | 211 | chmod(zFilename, buf.st_mode & ~0111); |
| 211 | 212 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -199,12 +199,13 @@ | |
| 199 | int rc = 0; |
| 200 | #if !defined(_WIN32) |
| 201 | struct stat buf; |
| 202 | if( stat(zFilename, &buf)!=0 ) return 0; |
| 203 | if( onoff ){ |
| 204 | if( (buf.st_mode & 0111)!=0111 ){ |
| 205 | chmod(zFilename, buf.st_mode | 0111); |
| 206 | rc = 1; |
| 207 | } |
| 208 | }else{ |
| 209 | if( (buf.st_mode & 0111)!=0 ){ |
| 210 | chmod(zFilename, buf.st_mode & ~0111); |
| 211 |
| --- src/file.c | |
| +++ src/file.c | |
| @@ -199,12 +199,13 @@ | |
| 199 | int rc = 0; |
| 200 | #if !defined(_WIN32) |
| 201 | struct stat buf; |
| 202 | if( stat(zFilename, &buf)!=0 ) return 0; |
| 203 | if( onoff ){ |
| 204 | int targetMode = (buf.st_mode & 0444)>>2; |
| 205 | if( (buf.st_mode & 0111)!=targetMode ){ |
| 206 | chmod(zFilename, buf.st_mode | targetMode); |
| 207 | rc = 1; |
| 208 | } |
| 209 | }else{ |
| 210 | if( (buf.st_mode & 0111)!=0 ){ |
| 211 | chmod(zFilename, buf.st_mode & ~0111); |
| 212 |
+3
-2
| --- src/update.c | ||
| +++ src/update.c | ||
| @@ -429,12 +429,13 @@ | ||
| 429 | 429 | */ |
| 430 | 430 | if( nConflict && !nochangeFlag ){ |
| 431 | 431 | if( internalUpdate ){ |
| 432 | 432 | internalConflictCnt = nConflict; |
| 433 | 433 | }else{ |
| 434 | - fossil_print("WARNING: %d merge conflicts - see messages above for details.\n", | |
| 435 | - nConflict); | |
| 434 | + fossil_print( | |
| 435 | + "WARNING: %d merge conflicts - see messages above for details.\n", | |
| 436 | + nConflict); | |
| 436 | 437 | } |
| 437 | 438 | } |
| 438 | 439 | |
| 439 | 440 | /* |
| 440 | 441 | ** Clean up the mid and pid VFILE entries. Then commit the changes. |
| 441 | 442 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -429,12 +429,13 @@ | |
| 429 | */ |
| 430 | if( nConflict && !nochangeFlag ){ |
| 431 | if( internalUpdate ){ |
| 432 | internalConflictCnt = nConflict; |
| 433 | }else{ |
| 434 | fossil_print("WARNING: %d merge conflicts - see messages above for details.\n", |
| 435 | nConflict); |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | /* |
| 440 | ** Clean up the mid and pid VFILE entries. Then commit the changes. |
| 441 |
| --- src/update.c | |
| +++ src/update.c | |
| @@ -429,12 +429,13 @@ | |
| 429 | */ |
| 430 | if( nConflict && !nochangeFlag ){ |
| 431 | if( internalUpdate ){ |
| 432 | internalConflictCnt = nConflict; |
| 433 | }else{ |
| 434 | fossil_print( |
| 435 | "WARNING: %d merge conflicts - see messages above for details.\n", |
| 436 | nConflict); |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | /* |
| 441 | ** Clean up the mid and pid VFILE entries. Then commit the changes. |
| 442 |