Fossil SCM

Add the --allow-symlinks option to the test-file-environment command.

drh 2017-11-30 12:55 trunk
Commit cf1960e913fc45e9060f35b5a1b392c5817e0e73994688ff7775e064ee91a601
1 file changed +8 -3
+8 -3
--- src/file.c
+++ src/file.c
@@ -1032,26 +1032,31 @@
10321032
** Display the effective file handling subsystem "settings" and then
10331033
** display file system information about the files specified, if any.
10341034
**
10351035
** Options:
10361036
**
1037
-** --open-config Open the configuration database first.
1038
-** --slash Trailing slashes, if any, are retained.
1039
-** --reset Reset cached stat() info for each file.
1037
+** --allow-symlinks BOOLEAN Temporarily turn allow-symlinks on/off
1038
+** --open-config Open the configuration database first.
1039
+** --slash Trailing slashes, if any, are retained.
1040
+** --reset Reset cached stat() info for each file.
10401041
*/
10411042
void cmd_test_file_environment(void){
10421043
int i;
10431044
int slashFlag = find_option("slash",0,0)!=0;
10441045
int resetFlag = find_option("reset",0,0)!=0;
1046
+ const char *zAllow = find_option("allow-symlinks",0,1);
10451047
if( find_option("open-config", 0, 0)!=0 ){
10461048
Th_OpenConfig(1);
10471049
}
10481050
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
10491051
fossil_print("filenames_are_case_sensitive() = %d\n",
10501052
filenames_are_case_sensitive());
10511053
fossil_print("db_allow_symlinks_by_default() = %d\n",
10521054
db_allow_symlinks_by_default());
1055
+ if( zAllow ){
1056
+ g.allowSymlinks = !is_false(zAllow);
1057
+ }
10531058
fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks());
10541059
for(i=2; i<g.argc; i++){
10551060
emitFileStat(g.argv[i], slashFlag, resetFlag);
10561061
}
10571062
}
10581063
--- src/file.c
+++ src/file.c
@@ -1032,26 +1032,31 @@
1032 ** Display the effective file handling subsystem "settings" and then
1033 ** display file system information about the files specified, if any.
1034 **
1035 ** Options:
1036 **
1037 ** --open-config Open the configuration database first.
1038 ** --slash Trailing slashes, if any, are retained.
1039 ** --reset Reset cached stat() info for each file.
 
1040 */
1041 void cmd_test_file_environment(void){
1042 int i;
1043 int slashFlag = find_option("slash",0,0)!=0;
1044 int resetFlag = find_option("reset",0,0)!=0;
 
1045 if( find_option("open-config", 0, 0)!=0 ){
1046 Th_OpenConfig(1);
1047 }
1048 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
1049 fossil_print("filenames_are_case_sensitive() = %d\n",
1050 filenames_are_case_sensitive());
1051 fossil_print("db_allow_symlinks_by_default() = %d\n",
1052 db_allow_symlinks_by_default());
 
 
 
1053 fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks());
1054 for(i=2; i<g.argc; i++){
1055 emitFileStat(g.argv[i], slashFlag, resetFlag);
1056 }
1057 }
1058
--- src/file.c
+++ src/file.c
@@ -1032,26 +1032,31 @@
1032 ** Display the effective file handling subsystem "settings" and then
1033 ** display file system information about the files specified, if any.
1034 **
1035 ** Options:
1036 **
1037 ** --allow-symlinks BOOLEAN Temporarily turn allow-symlinks on/off
1038 ** --open-config Open the configuration database first.
1039 ** --slash Trailing slashes, if any, are retained.
1040 ** --reset Reset cached stat() info for each file.
1041 */
1042 void cmd_test_file_environment(void){
1043 int i;
1044 int slashFlag = find_option("slash",0,0)!=0;
1045 int resetFlag = find_option("reset",0,0)!=0;
1046 const char *zAllow = find_option("allow-symlinks",0,1);
1047 if( find_option("open-config", 0, 0)!=0 ){
1048 Th_OpenConfig(1);
1049 }
1050 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
1051 fossil_print("filenames_are_case_sensitive() = %d\n",
1052 filenames_are_case_sensitive());
1053 fossil_print("db_allow_symlinks_by_default() = %d\n",
1054 db_allow_symlinks_by_default());
1055 if( zAllow ){
1056 g.allowSymlinks = !is_false(zAllow);
1057 }
1058 fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks());
1059 for(i=2; i<g.argc; i++){
1060 emitFileStat(g.argv[i], slashFlag, resetFlag);
1061 }
1062 }
1063

Keyboard Shortcuts

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