Fossil SCM

Fix the file_copy() procedure so that it sets the EXE bit on the copy if it was set on the source.

drh 2020-04-01 16:14 trunk
Commit cb2f254096081379d5a85945057af98f71c33b39d37490612b9833e30324acde
1 file changed +1
+1
--- src/file.c
+++ src/file.c
@@ -499,10 +499,11 @@
499499
while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
500500
fwrite(zBuf, 1, got, out);
501501
}
502502
fclose(in);
503503
fclose(out);
504
+ if( file_isexe(zFrom, ExtFILE) ) file_setexe(zTo, 1);
504505
}
505506
506507
/*
507508
** COMMAND: test-file-copy
508509
**
509510
--- src/file.c
+++ src/file.c
@@ -499,10 +499,11 @@
499 while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
500 fwrite(zBuf, 1, got, out);
501 }
502 fclose(in);
503 fclose(out);
 
504 }
505
506 /*
507 ** COMMAND: test-file-copy
508 **
509
--- src/file.c
+++ src/file.c
@@ -499,10 +499,11 @@
499 while( (got=fread(zBuf, 1, sizeof(zBuf), in))>0 ){
500 fwrite(zBuf, 1, got, out);
501 }
502 fclose(in);
503 fclose(out);
504 if( file_isexe(zFrom, ExtFILE) ) file_setexe(zTo, 1);
505 }
506
507 /*
508 ** COMMAND: test-file-copy
509 **
510

Keyboard Shortcuts

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