Fossil SCM

merged in trunk

stephan 2013-09-24 16:11 UTC usage-command merge
Commit 4fb3675a1a5b9962180750f419d34bcf996acbeb
+5 -1
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642642
"# and because no comment was specified using the \"-m\" or \"-M\"\n"
643643
"# command-line options, you will need to enter the comment below.\n"
644644
"# Type \".\" on a line by itself when you are done:\n", -1);
645645
zFile = mprintf("-");
646646
}else{
647
+ Blob fname;
648
+ blob_zero(&fname);
649
+ file_relative_name(g.zLocalRoot, &fname, 1);
647650
zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
648
- g.zLocalRoot);
651
+ blob_str(&fname));
652
+ blob_reset(&fname);
649653
}
650654
#if defined(_WIN32)
651655
blob_add_cr(pPrompt);
652656
#endif
653657
blob_write_to_file(pPrompt, zFile);
654658
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642 "# and because no comment was specified using the \"-m\" or \"-M\"\n"
643 "# command-line options, you will need to enter the comment below.\n"
644 "# Type \".\" on a line by itself when you are done:\n", -1);
645 zFile = mprintf("-");
646 }else{
 
 
 
647 zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
648 g.zLocalRoot);
 
649 }
650 #if defined(_WIN32)
651 blob_add_cr(pPrompt);
652 #endif
653 blob_write_to_file(pPrompt, zFile);
654
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642 "# and because no comment was specified using the \"-m\" or \"-M\"\n"
643 "# command-line options, you will need to enter the comment below.\n"
644 "# Type \".\" on a line by itself when you are done:\n", -1);
645 zFile = mprintf("-");
646 }else{
647 Blob fname;
648 blob_zero(&fname);
649 file_relative_name(g.zLocalRoot, &fname, 1);
650 zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
651 blob_str(&fname));
652 blob_reset(&fname);
653 }
654 #if defined(_WIN32)
655 blob_add_cr(pPrompt);
656 #endif
657 blob_write_to_file(pPrompt, zFile);
658
+5 -1
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642642
"# and because no comment was specified using the \"-m\" or \"-M\"\n"
643643
"# command-line options, you will need to enter the comment below.\n"
644644
"# Type \".\" on a line by itself when you are done:\n", -1);
645645
zFile = mprintf("-");
646646
}else{
647
+ Blob fname;
648
+ blob_zero(&fname);
649
+ file_relative_name(g.zLocalRoot, &fname, 1);
647650
zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
648
- g.zLocalRoot);
651
+ blob_str(&fname));
652
+ blob_reset(&fname);
649653
}
650654
#if defined(_WIN32)
651655
blob_add_cr(pPrompt);
652656
#endif
653657
blob_write_to_file(pPrompt, zFile);
654658
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642 "# and because no comment was specified using the \"-m\" or \"-M\"\n"
643 "# command-line options, you will need to enter the comment below.\n"
644 "# Type \".\" on a line by itself when you are done:\n", -1);
645 zFile = mprintf("-");
646 }else{
 
 
 
647 zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
648 g.zLocalRoot);
 
649 }
650 #if defined(_WIN32)
651 blob_add_cr(pPrompt);
652 #endif
653 blob_write_to_file(pPrompt, zFile);
654
--- src/checkin.c
+++ src/checkin.c
@@ -642,12 +642,16 @@
642 "# and because no comment was specified using the \"-m\" or \"-M\"\n"
643 "# command-line options, you will need to enter the comment below.\n"
644 "# Type \".\" on a line by itself when you are done:\n", -1);
645 zFile = mprintf("-");
646 }else{
647 Blob fname;
648 blob_zero(&fname);
649 file_relative_name(g.zLocalRoot, &fname, 1);
650 zFile = db_text(0, "SELECT '%qci-comment-' || hex(randomblob(6)) || '.txt'",
651 blob_str(&fname));
652 blob_reset(&fname);
653 }
654 #if defined(_WIN32)
655 blob_add_cr(pPrompt);
656 #endif
657 blob_write_to_file(pPrompt, zFile);
658
+11 -5
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794794
** Also test Fossil's ability to measure attributes of a file.
795795
*/
796796
void cmd_test_canonical_name(void){
797797
int i;
798798
Blob x;
799
+ int slashFlag = find_option("slash",0,0)!=0;
799800
blob_zero(&x);
800801
for(i=2; i<g.argc; i++){
801802
char zBuf[100];
802803
const char *zName = g.argv[i];
803
- file_canonical_name(zName, &x, 0);
804
+ file_canonical_name(zName, &x, slashFlag);
804805
fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805806
blob_reset(&x);
806807
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807808
fossil_print(" file_size = %s\n", zBuf);
808809
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
876877
while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
877878
#else
878879
while( zPath[i] && zPwd[i]==zPath[i] ) i++;
879880
#endif
880881
if( zPath[i]==0 ){
881
- blob_reset(pOut);
882
+ memcpy(&tmp, pOut, sizeof(tmp));
882883
if( zPwd[i]==0 ){
883
- blob_append(pOut, ".", 1);
884
+ blob_set(pOut, ".");
884885
}else{
885
- blob_append(pOut, "..", 2);
886
+ blob_set(pOut, "..");
886887
for(j=i+1; zPwd[j]; j++){
887888
if( zPwd[j]=='/' ){
888889
blob_append(pOut, "/..", 3);
889890
}
890891
}
891892
}
893
+ if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
894
+ blob_append(pOut, "/", 1);
895
+ }
896
+ blob_reset(&tmp);
892897
return;
893898
}
894899
if( zPwd[i]==0 && zPath[i]=='/' ){
895900
memcpy(&tmp, pOut, sizeof(tmp));
896901
blob_set(pOut, "./");
@@ -917,13 +922,14 @@
917922
** Test the operation of the relative name generator.
918923
*/
919924
void cmd_test_relative_name(void){
920925
int i;
921926
Blob x;
927
+ int slashFlag = find_option("slash",0,0)!=0;
922928
blob_zero(&x);
923929
for(i=2; i<g.argc; i++){
924
- file_relative_name(g.argv[i], &x, 0);
930
+ file_relative_name(g.argv[i], &x, slashFlag);
925931
fossil_print("%s\n", blob_buffer(&x));
926932
blob_reset(&x);
927933
}
928934
}
929935
930936
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
 
799 blob_zero(&x);
800 for(i=2; i<g.argc; i++){
801 char zBuf[100];
802 const char *zName = g.argv[i];
803 file_canonical_name(zName, &x, 0);
804 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805 blob_reset(&x);
806 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807 fossil_print(" file_size = %s\n", zBuf);
808 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
876 while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
877 #else
878 while( zPath[i] && zPwd[i]==zPath[i] ) i++;
879 #endif
880 if( zPath[i]==0 ){
881 blob_reset(pOut);
882 if( zPwd[i]==0 ){
883 blob_append(pOut, ".", 1);
884 }else{
885 blob_append(pOut, "..", 2);
886 for(j=i+1; zPwd[j]; j++){
887 if( zPwd[j]=='/' ){
888 blob_append(pOut, "/..", 3);
889 }
890 }
891 }
 
 
 
 
892 return;
893 }
894 if( zPwd[i]==0 && zPath[i]=='/' ){
895 memcpy(&tmp, pOut, sizeof(tmp));
896 blob_set(pOut, "./");
@@ -917,13 +922,14 @@
917 ** Test the operation of the relative name generator.
918 */
919 void cmd_test_relative_name(void){
920 int i;
921 Blob x;
 
922 blob_zero(&x);
923 for(i=2; i<g.argc; i++){
924 file_relative_name(g.argv[i], &x, 0);
925 fossil_print("%s\n", blob_buffer(&x));
926 blob_reset(&x);
927 }
928 }
929
930
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
799 int slashFlag = find_option("slash",0,0)!=0;
800 blob_zero(&x);
801 for(i=2; i<g.argc; i++){
802 char zBuf[100];
803 const char *zName = g.argv[i];
804 file_canonical_name(zName, &x, slashFlag);
805 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
806 blob_reset(&x);
807 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
808 fossil_print(" file_size = %s\n", zBuf);
809 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
877 while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
878 #else
879 while( zPath[i] && zPwd[i]==zPath[i] ) i++;
880 #endif
881 if( zPath[i]==0 ){
882 memcpy(&tmp, pOut, sizeof(tmp));
883 if( zPwd[i]==0 ){
884 blob_set(pOut, ".");
885 }else{
886 blob_set(pOut, "..");
887 for(j=i+1; zPwd[j]; j++){
888 if( zPwd[j]=='/' ){
889 blob_append(pOut, "/..", 3);
890 }
891 }
892 }
893 if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
894 blob_append(pOut, "/", 1);
895 }
896 blob_reset(&tmp);
897 return;
898 }
899 if( zPwd[i]==0 && zPath[i]=='/' ){
900 memcpy(&tmp, pOut, sizeof(tmp));
901 blob_set(pOut, "./");
@@ -917,13 +922,14 @@
922 ** Test the operation of the relative name generator.
923 */
924 void cmd_test_relative_name(void){
925 int i;
926 Blob x;
927 int slashFlag = find_option("slash",0,0)!=0;
928 blob_zero(&x);
929 for(i=2; i<g.argc; i++){
930 file_relative_name(g.argv[i], &x, slashFlag);
931 fossil_print("%s\n", blob_buffer(&x));
932 blob_reset(&x);
933 }
934 }
935
936
+11 -5
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794794
** Also test Fossil's ability to measure attributes of a file.
795795
*/
796796
void cmd_test_canonical_name(void){
797797
int i;
798798
Blob x;
799
+ int slashFlag = find_option("slash",0,0)!=0;
799800
blob_zero(&x);
800801
for(i=2; i<g.argc; i++){
801802
char zBuf[100];
802803
const char *zName = g.argv[i];
803
- file_canonical_name(zName, &x, 0);
804
+ file_canonical_name(zName, &x, slashFlag);
804805
fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805806
blob_reset(&x);
806807
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807808
fossil_print(" file_size = %s\n", zBuf);
808809
sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
876877
while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
877878
#else
878879
while( zPath[i] && zPwd[i]==zPath[i] ) i++;
879880
#endif
880881
if( zPath[i]==0 ){
881
- blob_reset(pOut);
882
+ memcpy(&tmp, pOut, sizeof(tmp));
882883
if( zPwd[i]==0 ){
883
- blob_append(pOut, ".", 1);
884
+ blob_set(pOut, ".");
884885
}else{
885
- blob_append(pOut, "..", 2);
886
+ blob_set(pOut, "..");
886887
for(j=i+1; zPwd[j]; j++){
887888
if( zPwd[j]=='/' ){
888889
blob_append(pOut, "/..", 3);
889890
}
890891
}
891892
}
893
+ if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
894
+ blob_append(pOut, "/", 1);
895
+ }
896
+ blob_reset(&tmp);
892897
return;
893898
}
894899
if( zPwd[i]==0 && zPath[i]=='/' ){
895900
memcpy(&tmp, pOut, sizeof(tmp));
896901
blob_set(pOut, "./");
@@ -917,13 +922,14 @@
917922
** Test the operation of the relative name generator.
918923
*/
919924
void cmd_test_relative_name(void){
920925
int i;
921926
Blob x;
927
+ int slashFlag = find_option("slash",0,0)!=0;
922928
blob_zero(&x);
923929
for(i=2; i<g.argc; i++){
924
- file_relative_name(g.argv[i], &x, 0);
930
+ file_relative_name(g.argv[i], &x, slashFlag);
925931
fossil_print("%s\n", blob_buffer(&x));
926932
blob_reset(&x);
927933
}
928934
}
929935
930936
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
 
799 blob_zero(&x);
800 for(i=2; i<g.argc; i++){
801 char zBuf[100];
802 const char *zName = g.argv[i];
803 file_canonical_name(zName, &x, 0);
804 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
805 blob_reset(&x);
806 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
807 fossil_print(" file_size = %s\n", zBuf);
808 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
876 while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
877 #else
878 while( zPath[i] && zPwd[i]==zPath[i] ) i++;
879 #endif
880 if( zPath[i]==0 ){
881 blob_reset(pOut);
882 if( zPwd[i]==0 ){
883 blob_append(pOut, ".", 1);
884 }else{
885 blob_append(pOut, "..", 2);
886 for(j=i+1; zPwd[j]; j++){
887 if( zPwd[j]=='/' ){
888 blob_append(pOut, "/..", 3);
889 }
890 }
891 }
 
 
 
 
892 return;
893 }
894 if( zPwd[i]==0 && zPath[i]=='/' ){
895 memcpy(&tmp, pOut, sizeof(tmp));
896 blob_set(pOut, "./");
@@ -917,13 +922,14 @@
917 ** Test the operation of the relative name generator.
918 */
919 void cmd_test_relative_name(void){
920 int i;
921 Blob x;
 
922 blob_zero(&x);
923 for(i=2; i<g.argc; i++){
924 file_relative_name(g.argv[i], &x, 0);
925 fossil_print("%s\n", blob_buffer(&x));
926 blob_reset(&x);
927 }
928 }
929
930
--- src/file.c
+++ src/file.c
@@ -794,15 +794,16 @@
794 ** Also test Fossil's ability to measure attributes of a file.
795 */
796 void cmd_test_canonical_name(void){
797 int i;
798 Blob x;
799 int slashFlag = find_option("slash",0,0)!=0;
800 blob_zero(&x);
801 for(i=2; i<g.argc; i++){
802 char zBuf[100];
803 const char *zName = g.argv[i];
804 file_canonical_name(zName, &x, slashFlag);
805 fossil_print("[%s] -> [%s]\n", zName, blob_buffer(&x));
806 blob_reset(&x);
807 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_size(zName));
808 fossil_print(" file_size = %s\n", zBuf);
809 sqlite3_snprintf(sizeof(zBuf), zBuf, "%lld", file_wd_mtime(zName));
@@ -876,21 +877,25 @@
877 while( zPath[i] && fossil_tolower(zPwd[i])==fossil_tolower(zPath[i]) ) i++;
878 #else
879 while( zPath[i] && zPwd[i]==zPath[i] ) i++;
880 #endif
881 if( zPath[i]==0 ){
882 memcpy(&tmp, pOut, sizeof(tmp));
883 if( zPwd[i]==0 ){
884 blob_set(pOut, ".");
885 }else{
886 blob_set(pOut, "..");
887 for(j=i+1; zPwd[j]; j++){
888 if( zPwd[j]=='/' ){
889 blob_append(pOut, "/..", 3);
890 }
891 }
892 }
893 if( slash && i>0 && zPath[strlen(zPath)-1]=='/'){
894 blob_append(pOut, "/", 1);
895 }
896 blob_reset(&tmp);
897 return;
898 }
899 if( zPwd[i]==0 && zPath[i]=='/' ){
900 memcpy(&tmp, pOut, sizeof(tmp));
901 blob_set(pOut, "./");
@@ -917,13 +922,14 @@
922 ** Test the operation of the relative name generator.
923 */
924 void cmd_test_relative_name(void){
925 int i;
926 Blob x;
927 int slashFlag = find_option("slash",0,0)!=0;
928 blob_zero(&x);
929 for(i=2; i<g.argc; i++){
930 file_relative_name(g.argv[i], &x, slashFlag);
931 fossil_print("%s\n", blob_buffer(&x));
932 blob_reset(&x);
933 }
934 }
935
936
+10
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344344
/*
345345
** atexit() handler which frees up "some" of the resources
346346
** used by fossil.
347347
*/
348348
static void fossil_atexit(void) {
349
+#if defined(_WIN32) && defined(USE_TCL_STUBS)
350
+ /* If Tcl is compiled on win32 using the latest mingw,
351
+ * fossil crashes when exiting while Tcl is still loaded.
352
+ * That's a bug in mingw, see:
353
+ * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354
+ * but the workaround is not that bad at all: */
355
+ if( g.tcl.library ){
356
+ FreeLibrary(g.tcl.library);
357
+ }
358
+#endif
349359
#ifdef FOSSIL_ENABLE_JSON
350360
cson_value_free(g.json.gc.v);
351361
memset(&g.json, 0, sizeof(g.json));
352362
#endif
353363
free(g.zErrMsg);
354364
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
 
 
 
 
 
 
 
 
 
 
349 #ifdef FOSSIL_ENABLE_JSON
350 cson_value_free(g.json.gc.v);
351 memset(&g.json, 0, sizeof(g.json));
352 #endif
353 free(g.zErrMsg);
354
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
349 #if defined(_WIN32) && defined(USE_TCL_STUBS)
350 /* If Tcl is compiled on win32 using the latest mingw,
351 * fossil crashes when exiting while Tcl is still loaded.
352 * That's a bug in mingw, see:
353 * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354 * but the workaround is not that bad at all: */
355 if( g.tcl.library ){
356 FreeLibrary(g.tcl.library);
357 }
358 #endif
359 #ifdef FOSSIL_ENABLE_JSON
360 cson_value_free(g.json.gc.v);
361 memset(&g.json, 0, sizeof(g.json));
362 #endif
363 free(g.zErrMsg);
364
+10
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344344
/*
345345
** atexit() handler which frees up "some" of the resources
346346
** used by fossil.
347347
*/
348348
static void fossil_atexit(void) {
349
+#if defined(_WIN32) && defined(USE_TCL_STUBS)
350
+ /* If Tcl is compiled on win32 using the latest mingw,
351
+ * fossil crashes when exiting while Tcl is still loaded.
352
+ * That's a bug in mingw, see:
353
+ * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354
+ * but the workaround is not that bad at all: */
355
+ if( g.tcl.library ){
356
+ FreeLibrary(g.tcl.library);
357
+ }
358
+#endif
349359
#ifdef FOSSIL_ENABLE_JSON
350360
cson_value_free(g.json.gc.v);
351361
memset(&g.json, 0, sizeof(g.json));
352362
#endif
353363
free(g.zErrMsg);
354364
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
 
 
 
 
 
 
 
 
 
 
349 #ifdef FOSSIL_ENABLE_JSON
350 cson_value_free(g.json.gc.v);
351 memset(&g.json, 0, sizeof(g.json));
352 #endif
353 free(g.zErrMsg);
354
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
349 #if defined(_WIN32) && defined(USE_TCL_STUBS)
350 /* If Tcl is compiled on win32 using the latest mingw,
351 * fossil crashes when exiting while Tcl is still loaded.
352 * That's a bug in mingw, see:
353 * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354 * but the workaround is not that bad at all: */
355 if( g.tcl.library ){
356 FreeLibrary(g.tcl.library);
357 }
358 #endif
359 #ifdef FOSSIL_ENABLE_JSON
360 cson_value_free(g.json.gc.v);
361 memset(&g.json, 0, sizeof(g.json));
362 #endif
363 free(g.zErrMsg);
364
+10
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344344
/*
345345
** atexit() handler which frees up "some" of the resources
346346
** used by fossil.
347347
*/
348348
static void fossil_atexit(void) {
349
+#if defined(_WIN32) && defined(USE_TCL_STUBS)
350
+ /* If Tcl is compiled on win32 using the latest mingw,
351
+ * fossil crashes when exiting while Tcl is still loaded.
352
+ * That's a bug in mingw, see:
353
+ * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354
+ * but the workaround is not that bad at all: */
355
+ if( g.tcl.library ){
356
+ FreeLibrary(g.tcl.library);
357
+ }
358
+#endif
349359
#ifdef FOSSIL_ENABLE_JSON
350360
cson_value_free(g.json.gc.v);
351361
memset(&g.json, 0, sizeof(g.json));
352362
#endif
353363
free(g.zErrMsg);
354364
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
 
 
 
 
 
 
 
 
 
 
349 #ifdef FOSSIL_ENABLE_JSON
350 cson_value_free(g.json.gc.v);
351 memset(&g.json, 0, sizeof(g.json));
352 #endif
353 free(g.zErrMsg);
354
--- src/main.c
+++ src/main.c
@@ -344,10 +344,20 @@
344 /*
345 ** atexit() handler which frees up "some" of the resources
346 ** used by fossil.
347 */
348 static void fossil_atexit(void) {
349 #if defined(_WIN32) && defined(USE_TCL_STUBS)
350 /* If Tcl is compiled on win32 using the latest mingw,
351 * fossil crashes when exiting while Tcl is still loaded.
352 * That's a bug in mingw, see:
353 * <http://comments.gmane.org/gmane.comp.gnu.mingw.user/41724>
354 * but the workaround is not that bad at all: */
355 if( g.tcl.library ){
356 FreeLibrary(g.tcl.library);
357 }
358 #endif
359 #ifdef FOSSIL_ENABLE_JSON
360 cson_value_free(g.json.gc.v);
361 memset(&g.json, 0, sizeof(g.json));
362 #endif
363 free(g.zErrMsg);
364
+3 -2
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671671
*pxCreateInterp = xCreateInterp;
672672
*pxDeleteInterp = xDeleteInterp;
673673
return TH_OK;
674674
}
675675
} while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676
- fileName[TCL_MINOR_OFFSET]++;
676
+ fileName[TCL_MINOR_OFFSET] = 'x';
677677
Th_ErrorMessage(interp,
678
- "could not load Tcl shared library \"", fileName, -1);
678
+ "could not load any supported Tcl 8.6, 8.5, or 8.4 shared library \"",
679
+ fileName, -1);
679680
return TH_ERROR;
680681
#else
681682
*pLibrary = 0;
682683
*pxFindExecutable = Tcl_FindExecutable;
683684
*pxCreateInterp = Tcl_CreateInterp;
684685
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671 *pxCreateInterp = xCreateInterp;
672 *pxDeleteInterp = xDeleteInterp;
673 return TH_OK;
674 }
675 } while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676 fileName[TCL_MINOR_OFFSET]++;
677 Th_ErrorMessage(interp,
678 "could not load Tcl shared library \"", fileName, -1);
 
679 return TH_ERROR;
680 #else
681 *pLibrary = 0;
682 *pxFindExecutable = Tcl_FindExecutable;
683 *pxCreateInterp = Tcl_CreateInterp;
684
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671 *pxCreateInterp = xCreateInterp;
672 *pxDeleteInterp = xDeleteInterp;
673 return TH_OK;
674 }
675 } while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676 fileName[TCL_MINOR_OFFSET] = 'x';
677 Th_ErrorMessage(interp,
678 "could not load any supported Tcl 8.6, 8.5, or 8.4 shared library \"",
679 fileName, -1);
680 return TH_ERROR;
681 #else
682 *pLibrary = 0;
683 *pxFindExecutable = Tcl_FindExecutable;
684 *pxCreateInterp = Tcl_CreateInterp;
685
+3 -2
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671671
*pxCreateInterp = xCreateInterp;
672672
*pxDeleteInterp = xDeleteInterp;
673673
return TH_OK;
674674
}
675675
} while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676
- fileName[TCL_MINOR_OFFSET]++;
676
+ fileName[TCL_MINOR_OFFSET] = 'x';
677677
Th_ErrorMessage(interp,
678
- "could not load Tcl shared library \"", fileName, -1);
678
+ "could not load any supported Tcl 8.6, 8.5, or 8.4 shared library \"",
679
+ fileName, -1);
679680
return TH_ERROR;
680681
#else
681682
*pLibrary = 0;
682683
*pxFindExecutable = Tcl_FindExecutable;
683684
*pxCreateInterp = Tcl_CreateInterp;
684685
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671 *pxCreateInterp = xCreateInterp;
672 *pxDeleteInterp = xDeleteInterp;
673 return TH_OK;
674 }
675 } while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676 fileName[TCL_MINOR_OFFSET]++;
677 Th_ErrorMessage(interp,
678 "could not load Tcl shared library \"", fileName, -1);
 
679 return TH_ERROR;
680 #else
681 *pLibrary = 0;
682 *pxFindExecutable = Tcl_FindExecutable;
683 *pxCreateInterp = Tcl_CreateInterp;
684
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -671,13 +671,14 @@
671 *pxCreateInterp = xCreateInterp;
672 *pxDeleteInterp = xDeleteInterp;
673 return TH_OK;
674 }
675 } while( --fileName[TCL_MINOR_OFFSET]>'3' ); /* Tcl 8.4+ */
676 fileName[TCL_MINOR_OFFSET] = 'x';
677 Th_ErrorMessage(interp,
678 "could not load any supported Tcl 8.6, 8.5, or 8.4 shared library \"",
679 fileName, -1);
680 return TH_ERROR;
681 #else
682 *pLibrary = 0;
683 *pxFindExecutable = Tcl_FindExecutable;
684 *pxCreateInterp = Tcl_CreateInterp;
685
+4 -6
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230230
** Returns the difference in CPU times in microseconds since
231231
** fossil_timer_start() was called and returned the given timer ID (or
232232
** since it was last reset). Returns 0 if timerId is out of range.
233233
*/
234234
sqlite3_uint64 fossil_timer_fetch(int timerId){
235
- if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
236
- return 0;
237
- }else{
235
+ if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
238236
struct FossilTimer * start = &fossilTimerList[timerId-1];
239237
if( !start->id ){
240238
fossil_fatal("Invalid call to fetch a non-allocated "
241239
"timer (#%d)", timerId);
242240
/*NOTREACHED*/
@@ -244,20 +242,19 @@
244242
sqlite3_uint64 eu = 0, es = 0;
245243
fossil_cpu_times( &eu, &es );
246244
return (eu - start->u) + (es - start->s);
247245
}
248246
}
247
+ return 0;
249248
}
250249
251250
/*
252251
** Resets the timer associated with the given ID, as obtained via
253252
** fossil_timer_start(), to the current CPU time values.
254253
*/
255254
sqlite3_uint64 fossil_timer_reset(int timerId){
256
- if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
257
- return 0;
258
- }else{
255
+ if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
259256
struct FossilTimer * start = &fossilTimerList[timerId-1];
260257
if( !start->id ){
261258
fossil_fatal("Invalid call to reset a non-allocated "
262259
"timer (#%d)", timerId);
263260
/*NOTREACHED*/
@@ -265,10 +262,11 @@
265262
sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
266263
fossil_cpu_times( &start->u, &start->s );
267264
return rc;
268265
}
269266
}
267
+ return 0;
270268
}
271269
272270
/**
273271
"Deallocates" the fossil timer identified by the given timer ID.
274272
returns the difference (in uSec) between the last time that timer
275273
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230 ** Returns the difference in CPU times in microseconds since
231 ** fossil_timer_start() was called and returned the given timer ID (or
232 ** since it was last reset). Returns 0 if timerId is out of range.
233 */
234 sqlite3_uint64 fossil_timer_fetch(int timerId){
235 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
236 return 0;
237 }else{
238 struct FossilTimer * start = &fossilTimerList[timerId-1];
239 if( !start->id ){
240 fossil_fatal("Invalid call to fetch a non-allocated "
241 "timer (#%d)", timerId);
242 /*NOTREACHED*/
@@ -244,20 +242,19 @@
244 sqlite3_uint64 eu = 0, es = 0;
245 fossil_cpu_times( &eu, &es );
246 return (eu - start->u) + (es - start->s);
247 }
248 }
 
249 }
250
251 /*
252 ** Resets the timer associated with the given ID, as obtained via
253 ** fossil_timer_start(), to the current CPU time values.
254 */
255 sqlite3_uint64 fossil_timer_reset(int timerId){
256 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
257 return 0;
258 }else{
259 struct FossilTimer * start = &fossilTimerList[timerId-1];
260 if( !start->id ){
261 fossil_fatal("Invalid call to reset a non-allocated "
262 "timer (#%d)", timerId);
263 /*NOTREACHED*/
@@ -265,10 +262,11 @@
265 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
266 fossil_cpu_times( &start->u, &start->s );
267 return rc;
268 }
269 }
 
270 }
271
272 /**
273 "Deallocates" the fossil timer identified by the given timer ID.
274 returns the difference (in uSec) between the last time that timer
275
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230 ** Returns the difference in CPU times in microseconds since
231 ** fossil_timer_start() was called and returned the given timer ID (or
232 ** since it was last reset). Returns 0 if timerId is out of range.
233 */
234 sqlite3_uint64 fossil_timer_fetch(int timerId){
235 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
 
 
236 struct FossilTimer * start = &fossilTimerList[timerId-1];
237 if( !start->id ){
238 fossil_fatal("Invalid call to fetch a non-allocated "
239 "timer (#%d)", timerId);
240 /*NOTREACHED*/
@@ -244,20 +242,19 @@
242 sqlite3_uint64 eu = 0, es = 0;
243 fossil_cpu_times( &eu, &es );
244 return (eu - start->u) + (es - start->s);
245 }
246 }
247 return 0;
248 }
249
250 /*
251 ** Resets the timer associated with the given ID, as obtained via
252 ** fossil_timer_start(), to the current CPU time values.
253 */
254 sqlite3_uint64 fossil_timer_reset(int timerId){
255 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
 
 
256 struct FossilTimer * start = &fossilTimerList[timerId-1];
257 if( !start->id ){
258 fossil_fatal("Invalid call to reset a non-allocated "
259 "timer (#%d)", timerId);
260 /*NOTREACHED*/
@@ -265,10 +262,11 @@
262 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
263 fossil_cpu_times( &start->u, &start->s );
264 return rc;
265 }
266 }
267 return 0;
268 }
269
270 /**
271 "Deallocates" the fossil timer identified by the given timer ID.
272 returns the difference (in uSec) between the last time that timer
273
+4 -6
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230230
** Returns the difference in CPU times in microseconds since
231231
** fossil_timer_start() was called and returned the given timer ID (or
232232
** since it was last reset). Returns 0 if timerId is out of range.
233233
*/
234234
sqlite3_uint64 fossil_timer_fetch(int timerId){
235
- if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
236
- return 0;
237
- }else{
235
+ if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
238236
struct FossilTimer * start = &fossilTimerList[timerId-1];
239237
if( !start->id ){
240238
fossil_fatal("Invalid call to fetch a non-allocated "
241239
"timer (#%d)", timerId);
242240
/*NOTREACHED*/
@@ -244,20 +242,19 @@
244242
sqlite3_uint64 eu = 0, es = 0;
245243
fossil_cpu_times( &eu, &es );
246244
return (eu - start->u) + (es - start->s);
247245
}
248246
}
247
+ return 0;
249248
}
250249
251250
/*
252251
** Resets the timer associated with the given ID, as obtained via
253252
** fossil_timer_start(), to the current CPU time values.
254253
*/
255254
sqlite3_uint64 fossil_timer_reset(int timerId){
256
- if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
257
- return 0;
258
- }else{
255
+ if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
259256
struct FossilTimer * start = &fossilTimerList[timerId-1];
260257
if( !start->id ){
261258
fossil_fatal("Invalid call to reset a non-allocated "
262259
"timer (#%d)", timerId);
263260
/*NOTREACHED*/
@@ -265,10 +262,11 @@
265262
sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
266263
fossil_cpu_times( &start->u, &start->s );
267264
return rc;
268265
}
269266
}
267
+ return 0;
270268
}
271269
272270
/**
273271
"Deallocates" the fossil timer identified by the given timer ID.
274272
returns the difference (in uSec) between the last time that timer
275273
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230 ** Returns the difference in CPU times in microseconds since
231 ** fossil_timer_start() was called and returned the given timer ID (or
232 ** since it was last reset). Returns 0 if timerId is out of range.
233 */
234 sqlite3_uint64 fossil_timer_fetch(int timerId){
235 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
236 return 0;
237 }else{
238 struct FossilTimer * start = &fossilTimerList[timerId-1];
239 if( !start->id ){
240 fossil_fatal("Invalid call to fetch a non-allocated "
241 "timer (#%d)", timerId);
242 /*NOTREACHED*/
@@ -244,20 +242,19 @@
244 sqlite3_uint64 eu = 0, es = 0;
245 fossil_cpu_times( &eu, &es );
246 return (eu - start->u) + (es - start->s);
247 }
248 }
 
249 }
250
251 /*
252 ** Resets the timer associated with the given ID, as obtained via
253 ** fossil_timer_start(), to the current CPU time values.
254 */
255 sqlite3_uint64 fossil_timer_reset(int timerId){
256 if(timerId<1 || timerId>FOSSIL_TIMER_COUNT){
257 return 0;
258 }else{
259 struct FossilTimer * start = &fossilTimerList[timerId-1];
260 if( !start->id ){
261 fossil_fatal("Invalid call to reset a non-allocated "
262 "timer (#%d)", timerId);
263 /*NOTREACHED*/
@@ -265,10 +262,11 @@
265 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
266 fossil_cpu_times( &start->u, &start->s );
267 return rc;
268 }
269 }
 
270 }
271
272 /**
273 "Deallocates" the fossil timer identified by the given timer ID.
274 returns the difference (in uSec) between the last time that timer
275
--- src/util.c
+++ src/util.c
@@ -230,13 +230,11 @@
230 ** Returns the difference in CPU times in microseconds since
231 ** fossil_timer_start() was called and returned the given timer ID (or
232 ** since it was last reset). Returns 0 if timerId is out of range.
233 */
234 sqlite3_uint64 fossil_timer_fetch(int timerId){
235 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
 
 
236 struct FossilTimer * start = &fossilTimerList[timerId-1];
237 if( !start->id ){
238 fossil_fatal("Invalid call to fetch a non-allocated "
239 "timer (#%d)", timerId);
240 /*NOTREACHED*/
@@ -244,20 +242,19 @@
242 sqlite3_uint64 eu = 0, es = 0;
243 fossil_cpu_times( &eu, &es );
244 return (eu - start->u) + (es - start->s);
245 }
246 }
247 return 0;
248 }
249
250 /*
251 ** Resets the timer associated with the given ID, as obtained via
252 ** fossil_timer_start(), to the current CPU time values.
253 */
254 sqlite3_uint64 fossil_timer_reset(int timerId){
255 if( timerId>0 && timerId<=FOSSIL_TIMER_COUNT ){
 
 
256 struct FossilTimer * start = &fossilTimerList[timerId-1];
257 if( !start->id ){
258 fossil_fatal("Invalid call to reset a non-allocated "
259 "timer (#%d)", timerId);
260 /*NOTREACHED*/
@@ -265,10 +262,11 @@
262 sqlite3_uint64 const rc = fossil_timer_fetch(timerId);
263 fossil_cpu_times( &start->u, &start->s );
264 return rc;
265 }
266 }
267 return 0;
268 }
269
270 /**
271 "Deallocates" the fossil timer identified by the given timer ID.
272 returns the difference (in uSec) between the last time that timer
273

Keyboard Shortcuts

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