Fossil SCM

When setting execute permission only set it for those levels that also have read permission.

drh 2011-06-06 17:17 trunk
Commit fd6f1c5e619fc297da692db468c839c33efec983
2 files changed +3 -2 +3 -2
+3 -2
--- src/file.c
+++ src/file.c
@@ -199,12 +199,13 @@
199199
int rc = 0;
200200
#if !defined(_WIN32)
201201
struct stat buf;
202202
if( stat(zFilename, &buf)!=0 ) return 0;
203203
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);
206207
rc = 1;
207208
}
208209
}else{
209210
if( (buf.st_mode & 0111)!=0 ){
210211
chmod(zFilename, buf.st_mode & ~0111);
211212
--- 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 @@
429429
*/
430430
if( nConflict && !nochangeFlag ){
431431
if( internalUpdate ){
432432
internalConflictCnt = nConflict;
433433
}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);
436437
}
437438
}
438439
439440
/*
440441
** Clean up the mid and pid VFILE entries. Then commit the changes.
441442
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button