Fossil SCM
Add the --allow-symlinks option to the test-file-environment command.
Commit
cf1960e913fc45e9060f35b5a1b392c5817e0e73994688ff7775e064ee91a601
Parent
c699e9fedf918eb…
1 file changed
+8
-3
+8
-3
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -1032,26 +1032,31 @@ | ||
| 1032 | 1032 | ** Display the effective file handling subsystem "settings" and then |
| 1033 | 1033 | ** display file system information about the files specified, if any. |
| 1034 | 1034 | ** |
| 1035 | 1035 | ** Options: |
| 1036 | 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. | |
| 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. | |
| 1040 | 1041 | */ |
| 1041 | 1042 | void cmd_test_file_environment(void){ |
| 1042 | 1043 | int i; |
| 1043 | 1044 | int slashFlag = find_option("slash",0,0)!=0; |
| 1044 | 1045 | int resetFlag = find_option("reset",0,0)!=0; |
| 1046 | + const char *zAllow = find_option("allow-symlinks",0,1); | |
| 1045 | 1047 | if( find_option("open-config", 0, 0)!=0 ){ |
| 1046 | 1048 | Th_OpenConfig(1); |
| 1047 | 1049 | } |
| 1048 | 1050 | db_find_and_open_repository(OPEN_ANY_SCHEMA, 0); |
| 1049 | 1051 | fossil_print("filenames_are_case_sensitive() = %d\n", |
| 1050 | 1052 | filenames_are_case_sensitive()); |
| 1051 | 1053 | fossil_print("db_allow_symlinks_by_default() = %d\n", |
| 1052 | 1054 | db_allow_symlinks_by_default()); |
| 1055 | + if( zAllow ){ | |
| 1056 | + g.allowSymlinks = !is_false(zAllow); | |
| 1057 | + } | |
| 1053 | 1058 | fossil_print("db_allow_symlinks() = %d\n", db_allow_symlinks()); |
| 1054 | 1059 | for(i=2; i<g.argc; i++){ |
| 1055 | 1060 | emitFileStat(g.argv[i], slashFlag, resetFlag); |
| 1056 | 1061 | } |
| 1057 | 1062 | } |
| 1058 | 1063 |
| --- 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 |