Fossil SCM

merge trunk

jan.nijtmans 2012-08-30 07:03 UTC eclipse-project merge
Commit 0387251bd3521cd7969bd1420fca426f9bfcac5d
+25 -2
--- src/file.c
+++ src/file.c
@@ -580,11 +580,11 @@
580580
#ifdef _WIN32
581581
char *zPwdUtf8;
582582
int nPwd;
583583
int i;
584584
wchar_t zPwd[2000];
585
- if( _wgetcwd(zPwd, sizeof(zPwd)-1)==0 ){
585
+ if( _wgetcwd(zPwd, sizeof(zPwd)/sizeof(zPwd[0])-1)==0 ){
586586
fossil_fatal("cannot find the current working directory.");
587587
}
588588
zPwdUtf8 = fossil_unicode_to_utf8(zPwd);
589589
nPwd = strlen(zPwdUtf8);
590590
if( nPwd > nBuf-1 ){
@@ -1003,10 +1003,34 @@
10031003
rc = blob_compare(&onDisk, pContent);
10041004
blob_reset(&onDisk);
10051005
return rc==0;
10061006
}
10071007
1008
+/*
1009
+** Portable unicode implementation of opendir()
1010
+*/
1011
+#if INTERFACE
1012
+
1013
+#if defined(_WIN32)
1014
+# include <dirent.h>
1015
+# define FOSSIL_DIR _WDIR
1016
+# define fossil_dirent _wdirent
1017
+# define fossil_opendir _wopendir
1018
+# define fossil_readdir _wreaddir
1019
+# define fossil_closedir _wclosedir
1020
+#else
1021
+# include <dirent.h>
1022
+# define FOSSIL_DIR DIR
1023
+# define fossil_dirent dirent
1024
+# define fossil_opendir opendir
1025
+# define fossil_readdir readdir
1026
+# define fossil_closedir closedir
1027
+#endif
1028
+
1029
+#endif /* INTERFACE */
1030
+
1031
+
10081032
10091033
/**************************************************************************
10101034
** The following routines translate between MBCS and UTF8 on windows.
10111035
** Since everything is always UTF8 on unix, these routines are no-ops
10121036
** there.
@@ -1029,11 +1053,10 @@
10291053
/*
10301054
** Translate Unicode to UTF8. Return a pointer to the translated text.
10311055
** Call fossil_mbcs_free() to deallocate any memory used to store the
10321056
** returned pointer when done.
10331057
*/
1034
-#undef fossil_unicode_to_utf8
10351058
char *fossil_unicode_to_utf8(const void *zUnicode){
10361059
#ifdef _WIN32
10371060
int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0);
10381061
char *zUtf = sqlite3_malloc( nByte );
10391062
if( zUtf==0 ){
10401063
--- src/file.c
+++ src/file.c
@@ -580,11 +580,11 @@
580 #ifdef _WIN32
581 char *zPwdUtf8;
582 int nPwd;
583 int i;
584 wchar_t zPwd[2000];
585 if( _wgetcwd(zPwd, sizeof(zPwd)-1)==0 ){
586 fossil_fatal("cannot find the current working directory.");
587 }
588 zPwdUtf8 = fossil_unicode_to_utf8(zPwd);
589 nPwd = strlen(zPwdUtf8);
590 if( nPwd > nBuf-1 ){
@@ -1003,10 +1003,34 @@
1003 rc = blob_compare(&onDisk, pContent);
1004 blob_reset(&onDisk);
1005 return rc==0;
1006 }
1007
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1008
1009 /**************************************************************************
1010 ** The following routines translate between MBCS and UTF8 on windows.
1011 ** Since everything is always UTF8 on unix, these routines are no-ops
1012 ** there.
@@ -1029,11 +1053,10 @@
1029 /*
1030 ** Translate Unicode to UTF8. Return a pointer to the translated text.
1031 ** Call fossil_mbcs_free() to deallocate any memory used to store the
1032 ** returned pointer when done.
1033 */
1034 #undef fossil_unicode_to_utf8
1035 char *fossil_unicode_to_utf8(const void *zUnicode){
1036 #ifdef _WIN32
1037 int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0);
1038 char *zUtf = sqlite3_malloc( nByte );
1039 if( zUtf==0 ){
1040
--- src/file.c
+++ src/file.c
@@ -580,11 +580,11 @@
580 #ifdef _WIN32
581 char *zPwdUtf8;
582 int nPwd;
583 int i;
584 wchar_t zPwd[2000];
585 if( _wgetcwd(zPwd, sizeof(zPwd)/sizeof(zPwd[0])-1)==0 ){
586 fossil_fatal("cannot find the current working directory.");
587 }
588 zPwdUtf8 = fossil_unicode_to_utf8(zPwd);
589 nPwd = strlen(zPwdUtf8);
590 if( nPwd > nBuf-1 ){
@@ -1003,10 +1003,34 @@
1003 rc = blob_compare(&onDisk, pContent);
1004 blob_reset(&onDisk);
1005 return rc==0;
1006 }
1007
1008 /*
1009 ** Portable unicode implementation of opendir()
1010 */
1011 #if INTERFACE
1012
1013 #if defined(_WIN32)
1014 # include <dirent.h>
1015 # define FOSSIL_DIR _WDIR
1016 # define fossil_dirent _wdirent
1017 # define fossil_opendir _wopendir
1018 # define fossil_readdir _wreaddir
1019 # define fossil_closedir _wclosedir
1020 #else
1021 # include <dirent.h>
1022 # define FOSSIL_DIR DIR
1023 # define fossil_dirent dirent
1024 # define fossil_opendir opendir
1025 # define fossil_readdir readdir
1026 # define fossil_closedir closedir
1027 #endif
1028
1029 #endif /* INTERFACE */
1030
1031
1032
1033 /**************************************************************************
1034 ** The following routines translate between MBCS and UTF8 on windows.
1035 ** Since everything is always UTF8 on unix, these routines are no-ops
1036 ** there.
@@ -1029,11 +1053,10 @@
1053 /*
1054 ** Translate Unicode to UTF8. Return a pointer to the translated text.
1055 ** Call fossil_mbcs_free() to deallocate any memory used to store the
1056 ** returned pointer when done.
1057 */
 
1058 char *fossil_unicode_to_utf8(const void *zUnicode){
1059 #ifdef _WIN32
1060 int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0);
1061 char *zUtf = sqlite3_malloc( nByte );
1062 if( zUtf==0 ){
1063
+11 -11
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607607
@ <div class="sectionmenu">
608608
showDiff = g.zPath[0]!='c';
609609
if( db_get_boolean("show-version-diffs", 0)==0 ){
610610
showDiff = !showDiff;
611611
if( showDiff ){
612
- @ %z(xhref("class='button'","%R/vinfo/%T",zName))
612
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName))
613613
@ hide&nbsp;diffs</a>
614614
if( sideBySide ){
615
- @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
615
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
616616
@ unified&nbsp;diffs</a>
617617
}else{
618
- @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
618
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
619619
@ side-by-side&nbsp;diffs</a>
620620
}
621621
}else{
622
- @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
622
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
623623
@ show&nbsp;unified&nbsp;diffs</a>
624
- @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
624
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
625625
@ show&nbsp;side-by-side&nbsp;diffs</a>
626626
}
627627
}else{
628628
if( showDiff ){
629
- @ %z(xhref("class='button'","%R/ci/%T",zName))hide&nbsp;diffs</a>
629
+ @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide&nbsp;diffs</a>
630630
if( sideBySide ){
631
- @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
631
+ @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName))
632632
@ unified&nbsp;diffs</a>
633633
}else{
634
- @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
634
+ @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName))
635635
@ side-by-side&nbsp;diffs</a>
636636
}
637637
}else{
638
- @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
638
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName))
639639
@ show&nbsp;unified&nbsp;diffs</a>
640
- @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
640
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName))
641641
@ show&nbsp;side-by-side&nbsp;diffs</a>
642642
}
643643
}
644
- @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
644
+ @ %z(xhref("class=\"button\"","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645645
@ patch</a></div>
646646
db_prepare(&q,
647647
"SELECT name,"
648648
" mperm,"
649649
" (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650650
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607 @ <div class="sectionmenu">
608 showDiff = g.zPath[0]!='c';
609 if( db_get_boolean("show-version-diffs", 0)==0 ){
610 showDiff = !showDiff;
611 if( showDiff ){
612 @ %z(xhref("class='button'","%R/vinfo/%T",zName))
613 @ hide&nbsp;diffs</a>
614 if( sideBySide ){
615 @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
616 @ unified&nbsp;diffs</a>
617 }else{
618 @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
619 @ side-by-side&nbsp;diffs</a>
620 }
621 }else{
622 @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
623 @ show&nbsp;unified&nbsp;diffs</a>
624 @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
625 @ show&nbsp;side-by-side&nbsp;diffs</a>
626 }
627 }else{
628 if( showDiff ){
629 @ %z(xhref("class='button'","%R/ci/%T",zName))hide&nbsp;diffs</a>
630 if( sideBySide ){
631 @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
632 @ unified&nbsp;diffs</a>
633 }else{
634 @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
635 @ side-by-side&nbsp;diffs</a>
636 }
637 }else{
638 @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
639 @ show&nbsp;unified&nbsp;diffs</a>
640 @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
641 @ show&nbsp;side-by-side&nbsp;diffs</a>
642 }
643 }
644 @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645 @ patch</a></div>
646 db_prepare(&q,
647 "SELECT name,"
648 " mperm,"
649 " (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607 @ <div class="sectionmenu">
608 showDiff = g.zPath[0]!='c';
609 if( db_get_boolean("show-version-diffs", 0)==0 ){
610 showDiff = !showDiff;
611 if( showDiff ){
612 @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName))
613 @ hide&nbsp;diffs</a>
614 if( sideBySide ){
615 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
616 @ unified&nbsp;diffs</a>
617 }else{
618 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
619 @ side-by-side&nbsp;diffs</a>
620 }
621 }else{
622 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
623 @ show&nbsp;unified&nbsp;diffs</a>
624 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
625 @ show&nbsp;side-by-side&nbsp;diffs</a>
626 }
627 }else{
628 if( showDiff ){
629 @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide&nbsp;diffs</a>
630 if( sideBySide ){
631 @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName))
632 @ unified&nbsp;diffs</a>
633 }else{
634 @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName))
635 @ side-by-side&nbsp;diffs</a>
636 }
637 }else{
638 @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName))
639 @ show&nbsp;unified&nbsp;diffs</a>
640 @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName))
641 @ show&nbsp;side-by-side&nbsp;diffs</a>
642 }
643 }
644 @ %z(xhref("class=\"button\"","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645 @ patch</a></div>
646 db_prepare(&q,
647 "SELECT name,"
648 " mperm,"
649 " (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650
+11 -11
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607607
@ <div class="sectionmenu">
608608
showDiff = g.zPath[0]!='c';
609609
if( db_get_boolean("show-version-diffs", 0)==0 ){
610610
showDiff = !showDiff;
611611
if( showDiff ){
612
- @ %z(xhref("class='button'","%R/vinfo/%T",zName))
612
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName))
613613
@ hide&nbsp;diffs</a>
614614
if( sideBySide ){
615
- @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
615
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
616616
@ unified&nbsp;diffs</a>
617617
}else{
618
- @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
618
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
619619
@ side-by-side&nbsp;diffs</a>
620620
}
621621
}else{
622
- @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
622
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
623623
@ show&nbsp;unified&nbsp;diffs</a>
624
- @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
624
+ @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
625625
@ show&nbsp;side-by-side&nbsp;diffs</a>
626626
}
627627
}else{
628628
if( showDiff ){
629
- @ %z(xhref("class='button'","%R/ci/%T",zName))hide&nbsp;diffs</a>
629
+ @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide&nbsp;diffs</a>
630630
if( sideBySide ){
631
- @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
631
+ @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName))
632632
@ unified&nbsp;diffs</a>
633633
}else{
634
- @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
634
+ @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName))
635635
@ side-by-side&nbsp;diffs</a>
636636
}
637637
}else{
638
- @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
638
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName))
639639
@ show&nbsp;unified&nbsp;diffs</a>
640
- @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
640
+ @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName))
641641
@ show&nbsp;side-by-side&nbsp;diffs</a>
642642
}
643643
}
644
- @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
644
+ @ %z(xhref("class=\"button\"","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645645
@ patch</a></div>
646646
db_prepare(&q,
647647
"SELECT name,"
648648
" mperm,"
649649
" (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650650
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607 @ <div class="sectionmenu">
608 showDiff = g.zPath[0]!='c';
609 if( db_get_boolean("show-version-diffs", 0)==0 ){
610 showDiff = !showDiff;
611 if( showDiff ){
612 @ %z(xhref("class='button'","%R/vinfo/%T",zName))
613 @ hide&nbsp;diffs</a>
614 if( sideBySide ){
615 @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
616 @ unified&nbsp;diffs</a>
617 }else{
618 @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
619 @ side-by-side&nbsp;diffs</a>
620 }
621 }else{
622 @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName))
623 @ show&nbsp;unified&nbsp;diffs</a>
624 @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName))
625 @ show&nbsp;side-by-side&nbsp;diffs</a>
626 }
627 }else{
628 if( showDiff ){
629 @ %z(xhref("class='button'","%R/ci/%T",zName))hide&nbsp;diffs</a>
630 if( sideBySide ){
631 @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName))
632 @ unified&nbsp;diffs</a>
633 }else{
634 @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName))
635 @ side-by-side&nbsp;diffs</a>
636 }
637 }else{
638 @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName))
639 @ show&nbsp;unified&nbsp;diffs</a>
640 @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName))
641 @ show&nbsp;side-by-side&nbsp;diffs</a>
642 }
643 }
644 @ %z(xhref("class='button'","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645 @ patch</a></div>
646 db_prepare(&q,
647 "SELECT name,"
648 " mperm,"
649 " (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650
--- src/info.c
+++ src/info.c
@@ -607,43 +607,43 @@
607 @ <div class="sectionmenu">
608 showDiff = g.zPath[0]!='c';
609 if( db_get_boolean("show-version-diffs", 0)==0 ){
610 showDiff = !showDiff;
611 if( showDiff ){
612 @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName))
613 @ hide&nbsp;diffs</a>
614 if( sideBySide ){
615 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
616 @ unified&nbsp;diffs</a>
617 }else{
618 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
619 @ side-by-side&nbsp;diffs</a>
620 }
621 }else{
622 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName))
623 @ show&nbsp;unified&nbsp;diffs</a>
624 @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName))
625 @ show&nbsp;side-by-side&nbsp;diffs</a>
626 }
627 }else{
628 if( showDiff ){
629 @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide&nbsp;diffs</a>
630 if( sideBySide ){
631 @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName))
632 @ unified&nbsp;diffs</a>
633 }else{
634 @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName))
635 @ side-by-side&nbsp;diffs</a>
636 }
637 }else{
638 @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName))
639 @ show&nbsp;unified&nbsp;diffs</a>
640 @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName))
641 @ show&nbsp;side-by-side&nbsp;diffs</a>
642 }
643 }
644 @ %z(xhref("class=\"button\"","%R/vpatch?from=%S&to=%S",zParent,zUuid))
645 @ patch</a></div>
646 db_prepare(&q,
647 "SELECT name,"
648 " mperm,"
649 " (SELECT uuid FROM blob WHERE rid=mlink.pid),"
650
+1 -1
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
3636
#endif
3737
#ifdef FOSSIL_ENABLE_TCL
3838
#include "tcl.h"
3939
#endif
4040
41
-#if !defined(_WIN32)
41
+#if !defined(_WIN32) || !defined(UNICODE)
4242
# define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
4343
# define wchar_t char
4444
# define wmain main
4545
#endif
4646
4747
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
36 #endif
37 #ifdef FOSSIL_ENABLE_TCL
38 #include "tcl.h"
39 #endif
40
41 #if !defined(_WIN32)
42 # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
43 # define wchar_t char
44 # define wmain main
45 #endif
46
47
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
36 #endif
37 #ifdef FOSSIL_ENABLE_TCL
38 #include "tcl.h"
39 #endif
40
41 #if !defined(_WIN32) || !defined(UNICODE)
42 # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
43 # define wchar_t char
44 # define wmain main
45 #endif
46
47
+1 -1
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
3636
#endif
3737
#ifdef FOSSIL_ENABLE_TCL
3838
#include "tcl.h"
3939
#endif
4040
41
-#if !defined(_WIN32)
41
+#if !defined(_WIN32) || !defined(UNICODE)
4242
# define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
4343
# define wchar_t char
4444
# define wmain main
4545
#endif
4646
4747
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
36 #endif
37 #ifdef FOSSIL_ENABLE_TCL
38 #include "tcl.h"
39 #endif
40
41 #if !defined(_WIN32)
42 # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
43 # define wchar_t char
44 # define wmain main
45 #endif
46
47
--- src/main.c
+++ src/main.c
@@ -36,11 +36,11 @@
36 #endif
37 #ifdef FOSSIL_ENABLE_TCL
38 #include "tcl.h"
39 #endif
40
41 #if !defined(_WIN32) || !defined(UNICODE)
42 # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8
43 # define wchar_t char
44 # define wmain main
45 #endif
46
47
+7 -2
--- src/merge.c
+++ src/merge.c
@@ -90,19 +90,22 @@
9090
** show what would have happened.
9191
**
9292
** --case-sensitive BOOL Overwrite the case-sensitive setting. If false,
9393
** files whose names differ only in case are taken
9494
** to be the same file.
95
+**
96
+** --force | -f Force the merge even if it would be a no-op.
9597
*/
9698
void merge_cmd(void){
9799
int vid; /* Current version "V" */
98100
int mid; /* Version we are merging from "M" */
99101
int pid; /* The pivot version - most recent common ancestor P */
100102
int detailFlag; /* True if the --detail option is present */
101103
int pickFlag; /* True if the --cherrypick option is present */
102104
int backoutFlag; /* True if the --backout option is present */
103105
int nochangeFlag; /* True if the --nochange or -n option is present */
106
+ int forceFlag; /* True if the --force or -f option is present */
104107
const char *zBinGlob; /* The value of --binary */
105108
const char *zPivot; /* The value of --baseline */
106109
int debugFlag; /* True if --debug is present */
107110
int nChng; /* Number of file name changes */
108111
int *aChng; /* An array of file name changes */
@@ -125,10 +128,11 @@
125128
pickFlag = find_option("cherrypick",0,0)!=0;
126129
backoutFlag = find_option("backout",0,0)!=0;
127130
debugFlag = find_option("debug",0,0)!=0;
128131
zBinGlob = find_option("binary",0,1);
129132
nochangeFlag = find_option("nochange","n",0)!=0;
133
+ forceFlag = find_option("force","f",0)!=0;
130134
zPivot = find_option("baseline",0,1);
131135
capture_case_sensitive_option();
132136
if( g.argc!=3 ){
133137
usage("VERSION");
134138
}
@@ -176,12 +180,13 @@
176180
mid = t;
177181
}
178182
if( !is_a_version(pid) ){
179183
fossil_fatal("not a version: record #%d", pid);
180184
}
181
- if( mid==pid ){
182
- fossil_print("This merge is a no-op.\n");
185
+ if( !forceFlag && (mid==pid || vid==pid || mid==vid) ){
186
+ fossil_print("Merge skipped because it is a no-op. "
187
+ " Use --force to override.\n");
183188
return;
184189
}
185190
if( detailFlag ){
186191
print_checkin_description(mid, 12, "merge-from:");
187192
print_checkin_description(pid, 12, "baseline:");
188193
--- src/merge.c
+++ src/merge.c
@@ -90,19 +90,22 @@
90 ** show what would have happened.
91 **
92 ** --case-sensitive BOOL Overwrite the case-sensitive setting. If false,
93 ** files whose names differ only in case are taken
94 ** to be the same file.
 
 
95 */
96 void merge_cmd(void){
97 int vid; /* Current version "V" */
98 int mid; /* Version we are merging from "M" */
99 int pid; /* The pivot version - most recent common ancestor P */
100 int detailFlag; /* True if the --detail option is present */
101 int pickFlag; /* True if the --cherrypick option is present */
102 int backoutFlag; /* True if the --backout option is present */
103 int nochangeFlag; /* True if the --nochange or -n option is present */
 
104 const char *zBinGlob; /* The value of --binary */
105 const char *zPivot; /* The value of --baseline */
106 int debugFlag; /* True if --debug is present */
107 int nChng; /* Number of file name changes */
108 int *aChng; /* An array of file name changes */
@@ -125,10 +128,11 @@
125 pickFlag = find_option("cherrypick",0,0)!=0;
126 backoutFlag = find_option("backout",0,0)!=0;
127 debugFlag = find_option("debug",0,0)!=0;
128 zBinGlob = find_option("binary",0,1);
129 nochangeFlag = find_option("nochange","n",0)!=0;
 
130 zPivot = find_option("baseline",0,1);
131 capture_case_sensitive_option();
132 if( g.argc!=3 ){
133 usage("VERSION");
134 }
@@ -176,12 +180,13 @@
176 mid = t;
177 }
178 if( !is_a_version(pid) ){
179 fossil_fatal("not a version: record #%d", pid);
180 }
181 if( mid==pid ){
182 fossil_print("This merge is a no-op.\n");
 
183 return;
184 }
185 if( detailFlag ){
186 print_checkin_description(mid, 12, "merge-from:");
187 print_checkin_description(pid, 12, "baseline:");
188
--- src/merge.c
+++ src/merge.c
@@ -90,19 +90,22 @@
90 ** show what would have happened.
91 **
92 ** --case-sensitive BOOL Overwrite the case-sensitive setting. If false,
93 ** files whose names differ only in case are taken
94 ** to be the same file.
95 **
96 ** --force | -f Force the merge even if it would be a no-op.
97 */
98 void merge_cmd(void){
99 int vid; /* Current version "V" */
100 int mid; /* Version we are merging from "M" */
101 int pid; /* The pivot version - most recent common ancestor P */
102 int detailFlag; /* True if the --detail option is present */
103 int pickFlag; /* True if the --cherrypick option is present */
104 int backoutFlag; /* True if the --backout option is present */
105 int nochangeFlag; /* True if the --nochange or -n option is present */
106 int forceFlag; /* True if the --force or -f option is present */
107 const char *zBinGlob; /* The value of --binary */
108 const char *zPivot; /* The value of --baseline */
109 int debugFlag; /* True if --debug is present */
110 int nChng; /* Number of file name changes */
111 int *aChng; /* An array of file name changes */
@@ -125,10 +128,11 @@
128 pickFlag = find_option("cherrypick",0,0)!=0;
129 backoutFlag = find_option("backout",0,0)!=0;
130 debugFlag = find_option("debug",0,0)!=0;
131 zBinGlob = find_option("binary",0,1);
132 nochangeFlag = find_option("nochange","n",0)!=0;
133 forceFlag = find_option("force","f",0)!=0;
134 zPivot = find_option("baseline",0,1);
135 capture_case_sensitive_option();
136 if( g.argc!=3 ){
137 usage("VERSION");
138 }
@@ -176,12 +180,13 @@
180 mid = t;
181 }
182 if( !is_a_version(pid) ){
183 fossil_fatal("not a version: record #%d", pid);
184 }
185 if( !forceFlag && (mid==pid || vid==pid || mid==vid) ){
186 fossil_print("Merge skipped because it is a no-op. "
187 " Use --force to override.\n");
188 return;
189 }
190 if( detailFlag ){
191 print_checkin_description(mid, 12, "merge-from:");
192 print_checkin_description(pid, 12, "baseline:");
193
+19 -1
--- src/mkversion.c
+++ src/mkversion.c
@@ -11,13 +11,15 @@
1111
#include <string.h>
1212
1313
int main(int argc, char *argv[]){
1414
FILE *m,*u,*v;
1515
char *z;
16
- int i, x;
16
+ int i, x, d;
1717
char b[1000];
1818
char vx[1000];
19
+ memset(b,0,sizeof(b));
20
+ memset(vx,0,sizeof(vx));
1921
u = fopen(argv[1],"r");
2022
fgets(b, sizeof(b)-1,u);
2123
fclose(u);
2224
for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
2325
*z = 0;
@@ -51,7 +53,23 @@
5153
}
5254
z++;
5355
}
5456
for(z=vx; z[0]=='0'; z++){}
5557
printf("#define RELEASE_VERSION_NUMBER %s\n", z);
58
+ memset(vx,0,sizeof(vx));
59
+ strcpy(vx,b);
60
+ d = 0;
61
+ for(z=vx; z[0]; z++){
62
+ if( z[0]!='.' ) continue;
63
+ if ( d<3 ){
64
+ z[0] = ',';
65
+ d++;
66
+ }else{
67
+ z[0] = '\0';
68
+ break;
69
+ }
70
+ }
71
+ printf("#define RELEASE_RESOURCE_VERSION %s", vx);
72
+ while( d<3 ){ printf(",0"); d++; }
73
+ printf("\n");
5674
return 0;
5775
}
5876
--- src/mkversion.c
+++ src/mkversion.c
@@ -11,13 +11,15 @@
11 #include <string.h>
12
13 int main(int argc, char *argv[]){
14 FILE *m,*u,*v;
15 char *z;
16 int i, x;
17 char b[1000];
18 char vx[1000];
 
 
19 u = fopen(argv[1],"r");
20 fgets(b, sizeof(b)-1,u);
21 fclose(u);
22 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
23 *z = 0;
@@ -51,7 +53,23 @@
51 }
52 z++;
53 }
54 for(z=vx; z[0]=='0'; z++){}
55 printf("#define RELEASE_VERSION_NUMBER %s\n", z);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56 return 0;
57 }
58
--- src/mkversion.c
+++ src/mkversion.c
@@ -11,13 +11,15 @@
11 #include <string.h>
12
13 int main(int argc, char *argv[]){
14 FILE *m,*u,*v;
15 char *z;
16 int i, x, d;
17 char b[1000];
18 char vx[1000];
19 memset(b,0,sizeof(b));
20 memset(vx,0,sizeof(vx));
21 u = fopen(argv[1],"r");
22 fgets(b, sizeof(b)-1,u);
23 fclose(u);
24 for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){}
25 *z = 0;
@@ -51,7 +53,23 @@
53 }
54 z++;
55 }
56 for(z=vx; z[0]=='0'; z++){}
57 printf("#define RELEASE_VERSION_NUMBER %s\n", z);
58 memset(vx,0,sizeof(vx));
59 strcpy(vx,b);
60 d = 0;
61 for(z=vx; z[0]; z++){
62 if( z[0]!='.' ) continue;
63 if ( d<3 ){
64 z[0] = ',';
65 d++;
66 }else{
67 z[0] = '\0';
68 break;
69 }
70 }
71 printf("#define RELEASE_RESOURCE_VERSION %s", vx);
72 while( d<3 ){ printf(",0"); d++; }
73 printf("\n");
74 return 0;
75 }
76
+8 -18
--- src/rebuild.c
+++ src/rebuild.c
@@ -18,22 +18,12 @@
1818
** This file contains code used to rebuild the database.
1919
*/
2020
#include "config.h"
2121
#include "rebuild.h"
2222
#include <assert.h>
23
-#include <dirent.h>
2423
#include <errno.h>
2524
26
-#ifndef _WIN32
27
-#define _WDIR DIR
28
-#define _wdirent dirent
29
-#define _wopendir opendir
30
-#define _wreaddir readdir
31
-#define _wclosedir closedir
32
-#define wchar_t char
33
-#endif
34
-
3525
/*
3626
** Make changes to the stable part of the schema (the part that is not
3727
** simply deleted and reconstructed on a rebuild) to bring the schema
3828
** up to the latest.
3929
*/
@@ -827,21 +817,21 @@
827817
/*
828818
** Recursively read all files from the directory zPath and install
829819
** every file read as a new artifact in the repository.
830820
*/
831821
void recon_read_dir(char *zPath){
832
- _WDIR *d;
833
- struct _wdirent *pEntry;
822
+ FOSSIL_DIR *d;
823
+ struct fossil_dirent *pEntry;
834824
Blob aContent; /* content of the just read artifact */
835825
static int nFileRead = 0;
836
- wchar_t *zMbcsPath;
826
+ void *zUnicodePath;
837827
char *zUtf8Name;
838828
839
- zMbcsPath = fossil_utf8_to_unicode(zPath);
840
- d = _wopendir(zMbcsPath);
829
+ zUnicodePath = fossil_utf8_to_unicode(zPath);
830
+ d = fossil_opendir(zUnicodePath);
841831
if( d ){
842
- while( (pEntry=_wreaddir(d))!=0 ){
832
+ while( (pEntry=fossil_readdir(d))!=0 ){
843833
Blob path;
844834
char *zSubpath;
845835
846836
if( pEntry->d_name[0]=='.' ){
847837
continue;
@@ -863,16 +853,16 @@
863853
blob_reset(&aContent);
864854
free(zSubpath);
865855
fossil_print("\r%d", ++nFileRead);
866856
fflush(stdout);
867857
}
868
- _wclosedir(d);
858
+ fossil_closedir(d);
869859
}else {
870860
fossil_panic("encountered error %d while trying to open \"%s\".",
871861
errno, g.argv[3]);
872862
}
873
- fossil_mbcs_free(zMbcsPath);
863
+ fossil_mbcs_free(zUnicodePath);
874864
}
875865
876866
/*
877867
** COMMAND: reconstruct*
878868
**
879869
--- src/rebuild.c
+++ src/rebuild.c
@@ -18,22 +18,12 @@
18 ** This file contains code used to rebuild the database.
19 */
20 #include "config.h"
21 #include "rebuild.h"
22 #include <assert.h>
23 #include <dirent.h>
24 #include <errno.h>
25
26 #ifndef _WIN32
27 #define _WDIR DIR
28 #define _wdirent dirent
29 #define _wopendir opendir
30 #define _wreaddir readdir
31 #define _wclosedir closedir
32 #define wchar_t char
33 #endif
34
35 /*
36 ** Make changes to the stable part of the schema (the part that is not
37 ** simply deleted and reconstructed on a rebuild) to bring the schema
38 ** up to the latest.
39 */
@@ -827,21 +817,21 @@
827 /*
828 ** Recursively read all files from the directory zPath and install
829 ** every file read as a new artifact in the repository.
830 */
831 void recon_read_dir(char *zPath){
832 _WDIR *d;
833 struct _wdirent *pEntry;
834 Blob aContent; /* content of the just read artifact */
835 static int nFileRead = 0;
836 wchar_t *zMbcsPath;
837 char *zUtf8Name;
838
839 zMbcsPath = fossil_utf8_to_unicode(zPath);
840 d = _wopendir(zMbcsPath);
841 if( d ){
842 while( (pEntry=_wreaddir(d))!=0 ){
843 Blob path;
844 char *zSubpath;
845
846 if( pEntry->d_name[0]=='.' ){
847 continue;
@@ -863,16 +853,16 @@
863 blob_reset(&aContent);
864 free(zSubpath);
865 fossil_print("\r%d", ++nFileRead);
866 fflush(stdout);
867 }
868 _wclosedir(d);
869 }else {
870 fossil_panic("encountered error %d while trying to open \"%s\".",
871 errno, g.argv[3]);
872 }
873 fossil_mbcs_free(zMbcsPath);
874 }
875
876 /*
877 ** COMMAND: reconstruct*
878 **
879
--- src/rebuild.c
+++ src/rebuild.c
@@ -18,22 +18,12 @@
18 ** This file contains code used to rebuild the database.
19 */
20 #include "config.h"
21 #include "rebuild.h"
22 #include <assert.h>
 
23 #include <errno.h>
24
 
 
 
 
 
 
 
 
 
25 /*
26 ** Make changes to the stable part of the schema (the part that is not
27 ** simply deleted and reconstructed on a rebuild) to bring the schema
28 ** up to the latest.
29 */
@@ -827,21 +817,21 @@
817 /*
818 ** Recursively read all files from the directory zPath and install
819 ** every file read as a new artifact in the repository.
820 */
821 void recon_read_dir(char *zPath){
822 FOSSIL_DIR *d;
823 struct fossil_dirent *pEntry;
824 Blob aContent; /* content of the just read artifact */
825 static int nFileRead = 0;
826 void *zUnicodePath;
827 char *zUtf8Name;
828
829 zUnicodePath = fossil_utf8_to_unicode(zPath);
830 d = fossil_opendir(zUnicodePath);
831 if( d ){
832 while( (pEntry=fossil_readdir(d))!=0 ){
833 Blob path;
834 char *zSubpath;
835
836 if( pEntry->d_name[0]=='.' ){
837 continue;
@@ -863,16 +853,16 @@
853 blob_reset(&aContent);
854 free(zSubpath);
855 fossil_print("\r%d", ++nFileRead);
856 fflush(stdout);
857 }
858 fossil_closedir(d);
859 }else {
860 fossil_panic("encountered error %d while trying to open \"%s\".",
861 errno, g.argv[3]);
862 }
863 fossil_mbcs_free(zUnicodePath);
864 }
865
866 /*
867 ** COMMAND: reconstruct*
868 **
869
+1 -1
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549549
);
550550
@ <ul>
551551
while( db_step(&q)==SQLITE_ROW ){
552552
const char *zName = db_column_text(&q, 0);
553553
if( g.perm.Hyperlink ){
554
- @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T",zName))
554
+ @ <li>%z(xhref("class=\"taglink\"","%R/timeline?t=%T",zName))
555555
@ %h(zName)</a></li>
556556
}else{
557557
@ <li><span class="tagDsp">%h(zName)</span></li>
558558
}
559559
}
560560
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549 );
550 @ <ul>
551 while( db_step(&q)==SQLITE_ROW ){
552 const char *zName = db_column_text(&q, 0);
553 if( g.perm.Hyperlink ){
554 @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T",zName))
555 @ %h(zName)</a></li>
556 }else{
557 @ <li><span class="tagDsp">%h(zName)</span></li>
558 }
559 }
560
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549 );
550 @ <ul>
551 while( db_step(&q)==SQLITE_ROW ){
552 const char *zName = db_column_text(&q, 0);
553 if( g.perm.Hyperlink ){
554 @ <li>%z(xhref("class=\"taglink\"","%R/timeline?t=%T",zName))
555 @ %h(zName)</a></li>
556 }else{
557 @ <li><span class="tagDsp">%h(zName)</span></li>
558 }
559 }
560
+1 -1
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549549
);
550550
@ <ul>
551551
while( db_step(&q)==SQLITE_ROW ){
552552
const char *zName = db_column_text(&q, 0);
553553
if( g.perm.Hyperlink ){
554
- @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T",zName))
554
+ @ <li>%z(xhref("class=\"taglink\"","%R/timeline?t=%T",zName))
555555
@ %h(zName)</a></li>
556556
}else{
557557
@ <li><span class="tagDsp">%h(zName)</span></li>
558558
}
559559
}
560560
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549 );
550 @ <ul>
551 while( db_step(&q)==SQLITE_ROW ){
552 const char *zName = db_column_text(&q, 0);
553 if( g.perm.Hyperlink ){
554 @ <li>%z(xhref("class='taglink'","%R/timeline?t=%T",zName))
555 @ %h(zName)</a></li>
556 }else{
557 @ <li><span class="tagDsp">%h(zName)</span></li>
558 }
559 }
560
--- src/tag.c
+++ src/tag.c
@@ -549,11 +549,11 @@
549 );
550 @ <ul>
551 while( db_step(&q)==SQLITE_ROW ){
552 const char *zName = db_column_text(&q, 0);
553 if( g.perm.Hyperlink ){
554 @ <li>%z(xhref("class=\"taglink\"","%R/timeline?t=%T",zName))
555 @ %h(zName)</a></li>
556 }else{
557 @ <li><span class="tagDsp">%h(zName)</span></li>
558 }
559 }
560
+9 -2
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -1,18 +1,25 @@
11
/*
2
+** Copyright © 2011 D. Richard Hipp
3
+** Copyright © 2011 Joe Mistachkin
4
+**
25
** This program is free software; you can redistribute it and/or
36
** modify it under the terms of the Simplified BSD License (also
47
** known as the "2-Clause License" or "FreeBSD License".)
5
-**
8
+
69
** This program is distributed in the hope that it will be useful,
710
** but without any warranty; without even the implied warranty of
811
** merchantability or fitness for a particular purpose.
12
+**
13
+** Author contact information:
14
+** [email protected]
15
+** http://www.hwaci.com/drh/
916
**
1017
*******************************************************************************
18
+**
1119
** This file contains code used to bridge the TH1 and Tcl scripting languages.
1220
*/
13
-
1421
#include "config.h"
1522
1623
#ifdef FOSSIL_ENABLE_TCL
1724
1825
#include "th.h"
1926
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -1,18 +1,25 @@
1 /*
 
 
 
2 ** This program is free software; you can redistribute it and/or
3 ** modify it under the terms of the Simplified BSD License (also
4 ** known as the "2-Clause License" or "FreeBSD License".)
5 **
6 ** This program is distributed in the hope that it will be useful,
7 ** but without any warranty; without even the implied warranty of
8 ** merchantability or fitness for a particular purpose.
 
 
 
 
9 **
10 *******************************************************************************
 
11 ** This file contains code used to bridge the TH1 and Tcl scripting languages.
12 */
13
14 #include "config.h"
15
16 #ifdef FOSSIL_ENABLE_TCL
17
18 #include "th.h"
19
--- src/th_tcl.c
+++ src/th_tcl.c
@@ -1,18 +1,25 @@
1 /*
2 ** Copyright © 2011 D. Richard Hipp
3 ** Copyright © 2011 Joe Mistachkin
4 **
5 ** This program is free software; you can redistribute it and/or
6 ** modify it under the terms of the Simplified BSD License (also
7 ** known as the "2-Clause License" or "FreeBSD License".)
8
9 ** This program is distributed in the hope that it will be useful,
10 ** but without any warranty; without even the implied warranty of
11 ** merchantability or fitness for a particular purpose.
12 **
13 ** Author contact information:
14 ** [email protected]
15 ** http://www.hwaci.com/drh/
16 **
17 *******************************************************************************
18 **
19 ** This file contains code used to bridge the TH1 and Tcl scripting languages.
20 */
 
21 #include "config.h"
22
23 #ifdef FOSSIL_ENABLE_TCL
24
25 #include "th.h"
26
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
4848
*/
4949
void hyperlink_to_uuid(const char *zUuid){
5050
char z[UUID_SIZE+1];
5151
shorten_uuid(z, zUuid);
5252
if( g.perm.Hyperlink ){
53
- @ %z(xhref("class='timelineHistLink'","%R/info/%s",z))[%s(z)]</a>
53
+ @ %z(xhref("class=\"timelineHistLink\"","%R/info/%s",z))[%s(z)]</a>
5454
}else{
5555
@ <span class="timelineHistDsp">[%s(z)]</span>
5656
}
5757
}
5858
5959
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
48 */
49 void hyperlink_to_uuid(const char *zUuid){
50 char z[UUID_SIZE+1];
51 shorten_uuid(z, zUuid);
52 if( g.perm.Hyperlink ){
53 @ %z(xhref("class='timelineHistLink'","%R/info/%s",z))[%s(z)]</a>
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
59
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
48 */
49 void hyperlink_to_uuid(const char *zUuid){
50 char z[UUID_SIZE+1];
51 shorten_uuid(z, zUuid);
52 if( g.perm.Hyperlink ){
53 @ %z(xhref("class=\"timelineHistLink\"","%R/info/%s",z))[%s(z)]</a>
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
59
+1 -1
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
4848
*/
4949
void hyperlink_to_uuid(const char *zUuid){
5050
char z[UUID_SIZE+1];
5151
shorten_uuid(z, zUuid);
5252
if( g.perm.Hyperlink ){
53
- @ %z(xhref("class='timelineHistLink'","%R/info/%s",z))[%s(z)]</a>
53
+ @ %z(xhref("class=\"timelineHistLink\"","%R/info/%s",z))[%s(z)]</a>
5454
}else{
5555
@ <span class="timelineHistDsp">[%s(z)]</span>
5656
}
5757
}
5858
5959
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
48 */
49 void hyperlink_to_uuid(const char *zUuid){
50 char z[UUID_SIZE+1];
51 shorten_uuid(z, zUuid);
52 if( g.perm.Hyperlink ){
53 @ %z(xhref("class='timelineHistLink'","%R/info/%s",z))[%s(z)]</a>
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
59
--- src/timeline.c
+++ src/timeline.c
@@ -48,11 +48,11 @@
48 */
49 void hyperlink_to_uuid(const char *zUuid){
50 char z[UUID_SIZE+1];
51 shorten_uuid(z, zUuid);
52 if( g.perm.Hyperlink ){
53 @ %z(xhref("class=\"timelineHistLink\"","%R/info/%s",z))[%s(z)]</a>
54 }else{
55 @ <span class="timelineHistDsp">[%s(z)]</span>
56 }
57 }
58
59
+6 -20
--- src/vfile.c
+++ src/vfile.c
@@ -19,24 +19,10 @@
1919
*/
2020
#include "config.h"
2121
#include "vfile.h"
2222
#include <assert.h>
2323
#include <sys/types.h>
24
-#if defined(__DMC__)
25
-#include "dirent.h"
26
-#else
27
-#include <dirent.h>
28
-#endif
29
-
30
-#ifndef _WIN32
31
-#define _WDIR DIR
32
-#define _wdirent dirent
33
-#define _wopendir opendir
34
-#define _wreaddir readdir
35
-#define _wclosedir closedir
36
-#define wchar_t char
37
-#endif
3824
3925
/*
4026
** The input is guaranteed to be a 40-character well-formed UUID.
4127
** Find its rid.
4228
*/
@@ -390,18 +376,18 @@
390376
** Any files or directories that match the glob pattern pIgnore are
391377
** excluded from the scan. Name matching occurs after the first
392378
** nPrefix characters are elided from the filename.
393379
*/
394380
void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){
395
- _WDIR *d;
381
+ FOSSIL_DIR *d;
396382
int origSize;
397383
const char *zDir;
398
- struct _wdirent *pEntry;
384
+ struct fossil_dirent *pEntry;
399385
int skipAll = 0;
400386
static Stmt ins;
401387
static int depth = 0;
402
- wchar_t *zMbcs;
388
+ void *zMbcs;
403389
404390
origSize = blob_size(pPath);
405391
if( pIgnore ){
406392
blob_appendf(pPath, "/");
407393
if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
@@ -417,13 +403,13 @@
417403
}
418404
depth++;
419405
420406
zDir = blob_str(pPath);
421407
zMbcs = fossil_utf8_to_unicode(zDir);
422
- d = _wopendir(zMbcs);
408
+ d = fossil_opendir(zMbcs);
423409
if( d ){
424
- while( (pEntry=_wreaddir(d))!=0 ){
410
+ while( (pEntry=fossil_readdir(d))!=0 ){
425411
char *zPath;
426412
char *zUtf8;
427413
if( pEntry->d_name[0]=='.' ){
428414
if( !allFlag ) continue;
429415
if( pEntry->d_name[1]==0 ) continue;
@@ -444,11 +430,11 @@
444430
db_step(&ins);
445431
db_reset(&ins);
446432
}
447433
blob_resize(pPath, origSize);
448434
}
449
- _wclosedir(d);
435
+ fossil_closedir(d);
450436
}
451437
fossil_mbcs_free(zMbcs);
452438
453439
depth--;
454440
if( depth==0 ){
455441
--- src/vfile.c
+++ src/vfile.c
@@ -19,24 +19,10 @@
19 */
20 #include "config.h"
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
24 #if defined(__DMC__)
25 #include "dirent.h"
26 #else
27 #include <dirent.h>
28 #endif
29
30 #ifndef _WIN32
31 #define _WDIR DIR
32 #define _wdirent dirent
33 #define _wopendir opendir
34 #define _wreaddir readdir
35 #define _wclosedir closedir
36 #define wchar_t char
37 #endif
38
39 /*
40 ** The input is guaranteed to be a 40-character well-formed UUID.
41 ** Find its rid.
42 */
@@ -390,18 +376,18 @@
390 ** Any files or directories that match the glob pattern pIgnore are
391 ** excluded from the scan. Name matching occurs after the first
392 ** nPrefix characters are elided from the filename.
393 */
394 void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){
395 _WDIR *d;
396 int origSize;
397 const char *zDir;
398 struct _wdirent *pEntry;
399 int skipAll = 0;
400 static Stmt ins;
401 static int depth = 0;
402 wchar_t *zMbcs;
403
404 origSize = blob_size(pPath);
405 if( pIgnore ){
406 blob_appendf(pPath, "/");
407 if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
@@ -417,13 +403,13 @@
417 }
418 depth++;
419
420 zDir = blob_str(pPath);
421 zMbcs = fossil_utf8_to_unicode(zDir);
422 d = _wopendir(zMbcs);
423 if( d ){
424 while( (pEntry=_wreaddir(d))!=0 ){
425 char *zPath;
426 char *zUtf8;
427 if( pEntry->d_name[0]=='.' ){
428 if( !allFlag ) continue;
429 if( pEntry->d_name[1]==0 ) continue;
@@ -444,11 +430,11 @@
444 db_step(&ins);
445 db_reset(&ins);
446 }
447 blob_resize(pPath, origSize);
448 }
449 _wclosedir(d);
450 }
451 fossil_mbcs_free(zMbcs);
452
453 depth--;
454 if( depth==0 ){
455
--- src/vfile.c
+++ src/vfile.c
@@ -19,24 +19,10 @@
19 */
20 #include "config.h"
21 #include "vfile.h"
22 #include <assert.h>
23 #include <sys/types.h>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
25 /*
26 ** The input is guaranteed to be a 40-character well-formed UUID.
27 ** Find its rid.
28 */
@@ -390,18 +376,18 @@
376 ** Any files or directories that match the glob pattern pIgnore are
377 ** excluded from the scan. Name matching occurs after the first
378 ** nPrefix characters are elided from the filename.
379 */
380 void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){
381 FOSSIL_DIR *d;
382 int origSize;
383 const char *zDir;
384 struct fossil_dirent *pEntry;
385 int skipAll = 0;
386 static Stmt ins;
387 static int depth = 0;
388 void *zMbcs;
389
390 origSize = blob_size(pPath);
391 if( pIgnore ){
392 blob_appendf(pPath, "/");
393 if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1;
@@ -417,13 +403,13 @@
403 }
404 depth++;
405
406 zDir = blob_str(pPath);
407 zMbcs = fossil_utf8_to_unicode(zDir);
408 d = fossil_opendir(zMbcs);
409 if( d ){
410 while( (pEntry=fossil_readdir(d))!=0 ){
411 char *zPath;
412 char *zUtf8;
413 if( pEntry->d_name[0]=='.' ){
414 if( !allFlag ) continue;
415 if( pEntry->d_name[1]==0 ) continue;
@@ -444,11 +430,11 @@
430 db_step(&ins);
431 db_reset(&ins);
432 }
433 blob_resize(pPath, origSize);
434 }
435 fossil_closedir(d);
436 }
437 fossil_mbcs_free(zMbcs);
438
439 depth--;
440 if( depth==0 ){
441
+2 -2
--- win/fossil.rc
+++ win/fossil.rc
@@ -58,12 +58,12 @@
5858
/*
5959
* Version
6060
*/
6161
6262
VS_VERSION_INFO VERSIONINFO
63
- FILEVERSION 1,0,0,0
64
- PRODUCTVERSION 1,0,0,0
63
+ FILEVERSION RELEASE_RESOURCE_VERSION
64
+ PRODUCTVERSION RELEASE_RESOURCE_VERSION
6565
FILEFLAGSMASK 0x3F
6666
#if defined(_DEBUG)
6767
FILEFLAGS 0x1L
6868
#else
6969
FILEFLAGS 0x0L
7070
--- win/fossil.rc
+++ win/fossil.rc
@@ -58,12 +58,12 @@
58 /*
59 * Version
60 */
61
62 VS_VERSION_INFO VERSIONINFO
63 FILEVERSION 1,0,0,0
64 PRODUCTVERSION 1,0,0,0
65 FILEFLAGSMASK 0x3F
66 #if defined(_DEBUG)
67 FILEFLAGS 0x1L
68 #else
69 FILEFLAGS 0x0L
70
--- win/fossil.rc
+++ win/fossil.rc
@@ -58,12 +58,12 @@
58 /*
59 * Version
60 */
61
62 VS_VERSION_INFO VERSIONINFO
63 FILEVERSION RELEASE_RESOURCE_VERSION
64 PRODUCTVERSION RELEASE_RESOURCE_VERSION
65 FILEFLAGSMASK 0x3F
66 #if defined(_DEBUG)
67 FILEFLAGS 0x1L
68 #else
69 FILEFLAGS 0x0L
70
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -61,71 +61,70 @@
6161
#include <windows.h>
6262
#include <string.h>
6363
#include <assert.h>
6464
6565
66
-typedef struct dirent
67
-{
68
- char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
69
- WIN32_FIND_DATAA data; /* file attributes */
70
-} dirent;
71
-
72
-
73
-typedef struct DIR
74
-{
75
- dirent current; /* Current directory entry */
66
+typedef struct _wdirent
67
+{
68
+ wchar_t d_name[MAX_PATH + 1]; /* current dir entry (unicode char string) */
69
+ WIN32_FIND_DATAW data; /* file attributes */
70
+} _wdirent;
71
+
72
+
73
+typedef struct _WDIR
74
+{
75
+ _wdirent current; /* Current directory entry */
7676
int cached; /* Indicates un-processed entry in memory */
7777
HANDLE search_handle; /* File search handle */
78
- char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
79
-} DIR;
78
+ wchar_t patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
79
+} _WDIR;
8080
8181
8282
/* Forward declarations */
83
-static DIR *opendir (const char *dirname);
84
-static struct dirent *readdir (DIR *dirp);
85
-static int closedir (DIR *dirp);
86
-static void rewinddir(DIR* dirp);
83
+static _WDIR *_wopendir (const wchar_t *dirname);
84
+static struct _wdirent *_wreaddir (_WDIR *dirp);
85
+static int _wclosedir (_WDIR *dirp);
8786
8887
8988
/* Use the new safe string functions introduced in Visual Studio 2005 */
9089
#if defined(_MSC_VER) && _MSC_VER >= 1400
91
-# define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
90
+# define STRNCPY(dest,src,size) wcsncpy_s((dest),(size),(src),_TRUNCATE)
9291
#else
93
-# define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
92
+# define STRNCPY(dest,src,size) wcsncpy((dest),(src),(size))
9493
#endif
9594
9695
9796
/*****************************************************************************
9897
* Open directory stream DIRNAME for read and return a pointer to the
9998
* internal working area that is used to retrieve individual directory
10099
* entries.
101100
*/
102
-static DIR *opendir(const char *dirname)
101
+static _WDIR *_wopendir(const wchar_t *dirname)
103102
{
104
- DIR *dirp;
103
+ _WDIR *dirp;
105104
assert (dirname != NULL);
106
- assert (strlen (dirname) < MAX_PATH);
105
+ assert (wcslen (dirname) < MAX_PATH);
107106
108
- /* construct new DIR structure */
109
- dirp = (DIR*) malloc (sizeof (struct DIR));
107
+ /* construct new _WDIR structure */
108
+ dirp = (_WDIR*) malloc (sizeof (struct _WDIR));
110109
if (dirp != NULL) {
111
- char *p;
110
+ wchar_t *p;
112111
113112
/* take directory name... */
114113
STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
115114
dirp->patt[MAX_PATH] = '\0';
116115
117116
/* ... and append search pattern to it */
118
- p = strchr (dirp->patt, '\0');
117
+ p = wcschr (dirp->patt, '\0');
119118
if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
120119
*p++ = '\\';
121120
}
122121
*p++ = '*';
123122
*p = '\0';
124123
125124
/* open stream and retrieve first file */
126
- dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
125
+ dirp->search_handle = FindFirstFileW (dirp->patt, &dirp->current.data);
127126
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
128127
/* invalid search pattern? */
129128
free (dirp);
130129
return NULL;
131130
}
@@ -143,11 +142,11 @@
143142
* containing the name of the entry in d_name field. Individual directory
144143
* entries returned by this very function include regular files,
145144
* sub-directories, pseudo-directories "." and "..", but also volume labels,
146145
* hidden files and system files may be returned.
147146
*/
148
-static struct dirent *readdir(DIR *dirp)
147
+static struct _wdirent *_wreaddir(_WDIR *dirp)
149148
{
150149
assert (dirp != NULL);
151150
152151
if (dirp->search_handle == INVALID_HANDLE_VALUE) {
153152
/* directory stream was opened/rewound incorrectly or ended normally */
@@ -158,11 +157,11 @@
158157
if (dirp->cached != 0) {
159158
/* a valid directory entry already in memory */
160159
dirp->cached = 0;
161160
} else {
162161
/* read next directory entry from disk */
163
- if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
162
+ if (FindNextFileW (dirp->search_handle, &dirp->current.data) == FALSE) {
164163
/* the very last file has been processed or an error occured */
165164
FindClose (dirp->search_handle);
166165
dirp->search_handle = INVALID_HANDLE_VALUE;
167166
return NULL;
168167
}
@@ -181,11 +180,11 @@
181180
/*****************************************************************************
182181
* Close directory stream opened by opendir() function. Close of the
183182
* directory stream invalidates the DIR structure as well as any previously
184183
* read directory entry.
185184
*/
186
-static int closedir(DIR *dirp)
185
+static int _wclosedir(_WDIR *dirp)
187186
{
188187
assert (dirp != NULL);
189188
190189
/* release search handle */
191190
if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@@ -195,36 +194,7 @@
195194
196195
/* release directory handle */
197196
free (dirp);
198197
return 0;
199198
}
200
-
201
-
202
-/*****************************************************************************
203
- * Resets the position of the directory stream to which dirp refers to the
204
- * beginning of the directory. It also causes the directory stream to refer
205
- * to the current state of the corresponding directory, as a call to opendir()
206
- * would have done. If dirp does not refer to a directory stream, the effect
207
- * is undefined.
208
- */
209
-static void rewinddir(DIR* dirp)
210
-{
211
- /* release search handle */
212
- if (dirp->search_handle != INVALID_HANDLE_VALUE) {
213
- FindClose (dirp->search_handle);
214
- dirp->search_handle = INVALID_HANDLE_VALUE;
215
- }
216
-
217
- /* open new search handle and retrieve first file */
218
- dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
219
- if (dirp->search_handle == INVALID_HANDLE_VALUE) {
220
- /* invalid search pattern? */
221
- free (dirp);
222
- return;
223
- }
224
-
225
- /* there is an un-processed directory entry in memory now */
226
- dirp->cached = 1;
227
-}
228
-
229199
230200
#endif /*DIRENT_H*/
231201
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -61,71 +61,70 @@
61 #include <windows.h>
62 #include <string.h>
63 #include <assert.h>
64
65
66 typedef struct dirent
67 {
68 char d_name[MAX_PATH + 1]; /* current dir entry (multi-byte char string) */
69 WIN32_FIND_DATAA data; /* file attributes */
70 } dirent;
71
72
73 typedef struct DIR
74 {
75 dirent current; /* Current directory entry */
76 int cached; /* Indicates un-processed entry in memory */
77 HANDLE search_handle; /* File search handle */
78 char patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
79 } DIR;
80
81
82 /* Forward declarations */
83 static DIR *opendir (const char *dirname);
84 static struct dirent *readdir (DIR *dirp);
85 static int closedir (DIR *dirp);
86 static void rewinddir(DIR* dirp);
87
88
89 /* Use the new safe string functions introduced in Visual Studio 2005 */
90 #if defined(_MSC_VER) && _MSC_VER >= 1400
91 # define STRNCPY(dest,src,size) strncpy_s((dest),(size),(src),_TRUNCATE)
92 #else
93 # define STRNCPY(dest,src,size) strncpy((dest),(src),(size))
94 #endif
95
96
97 /*****************************************************************************
98 * Open directory stream DIRNAME for read and return a pointer to the
99 * internal working area that is used to retrieve individual directory
100 * entries.
101 */
102 static DIR *opendir(const char *dirname)
103 {
104 DIR *dirp;
105 assert (dirname != NULL);
106 assert (strlen (dirname) < MAX_PATH);
107
108 /* construct new DIR structure */
109 dirp = (DIR*) malloc (sizeof (struct DIR));
110 if (dirp != NULL) {
111 char *p;
112
113 /* take directory name... */
114 STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
115 dirp->patt[MAX_PATH] = '\0';
116
117 /* ... and append search pattern to it */
118 p = strchr (dirp->patt, '\0');
119 if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
120 *p++ = '\\';
121 }
122 *p++ = '*';
123 *p = '\0';
124
125 /* open stream and retrieve first file */
126 dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
127 if (dirp->search_handle == INVALID_HANDLE_VALUE) {
128 /* invalid search pattern? */
129 free (dirp);
130 return NULL;
131 }
@@ -143,11 +142,11 @@
143 * containing the name of the entry in d_name field. Individual directory
144 * entries returned by this very function include regular files,
145 * sub-directories, pseudo-directories "." and "..", but also volume labels,
146 * hidden files and system files may be returned.
147 */
148 static struct dirent *readdir(DIR *dirp)
149 {
150 assert (dirp != NULL);
151
152 if (dirp->search_handle == INVALID_HANDLE_VALUE) {
153 /* directory stream was opened/rewound incorrectly or ended normally */
@@ -158,11 +157,11 @@
158 if (dirp->cached != 0) {
159 /* a valid directory entry already in memory */
160 dirp->cached = 0;
161 } else {
162 /* read next directory entry from disk */
163 if (FindNextFileA (dirp->search_handle, &dirp->current.data) == FALSE) {
164 /* the very last file has been processed or an error occured */
165 FindClose (dirp->search_handle);
166 dirp->search_handle = INVALID_HANDLE_VALUE;
167 return NULL;
168 }
@@ -181,11 +180,11 @@
181 /*****************************************************************************
182 * Close directory stream opened by opendir() function. Close of the
183 * directory stream invalidates the DIR structure as well as any previously
184 * read directory entry.
185 */
186 static int closedir(DIR *dirp)
187 {
188 assert (dirp != NULL);
189
190 /* release search handle */
191 if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@@ -195,36 +194,7 @@
195
196 /* release directory handle */
197 free (dirp);
198 return 0;
199 }
200
201
202 /*****************************************************************************
203 * Resets the position of the directory stream to which dirp refers to the
204 * beginning of the directory. It also causes the directory stream to refer
205 * to the current state of the corresponding directory, as a call to opendir()
206 * would have done. If dirp does not refer to a directory stream, the effect
207 * is undefined.
208 */
209 static void rewinddir(DIR* dirp)
210 {
211 /* release search handle */
212 if (dirp->search_handle != INVALID_HANDLE_VALUE) {
213 FindClose (dirp->search_handle);
214 dirp->search_handle = INVALID_HANDLE_VALUE;
215 }
216
217 /* open new search handle and retrieve first file */
218 dirp->search_handle = FindFirstFileA (dirp->patt, &dirp->current.data);
219 if (dirp->search_handle == INVALID_HANDLE_VALUE) {
220 /* invalid search pattern? */
221 free (dirp);
222 return;
223 }
224
225 /* there is an un-processed directory entry in memory now */
226 dirp->cached = 1;
227 }
228
229
230 #endif /*DIRENT_H*/
231
--- win/include/dirent.h
+++ win/include/dirent.h
@@ -61,71 +61,70 @@
61 #include <windows.h>
62 #include <string.h>
63 #include <assert.h>
64
65
66 typedef struct _wdirent
67 {
68 wchar_t d_name[MAX_PATH + 1]; /* current dir entry (unicode char string) */
69 WIN32_FIND_DATAW data; /* file attributes */
70 } _wdirent;
71
72
73 typedef struct _WDIR
74 {
75 _wdirent current; /* Current directory entry */
76 int cached; /* Indicates un-processed entry in memory */
77 HANDLE search_handle; /* File search handle */
78 wchar_t patt[MAX_PATH + 3]; /* search pattern (3 = pattern + "\\*\0") */
79 } _WDIR;
80
81
82 /* Forward declarations */
83 static _WDIR *_wopendir (const wchar_t *dirname);
84 static struct _wdirent *_wreaddir (_WDIR *dirp);
85 static int _wclosedir (_WDIR *dirp);
 
86
87
88 /* Use the new safe string functions introduced in Visual Studio 2005 */
89 #if defined(_MSC_VER) && _MSC_VER >= 1400
90 # define STRNCPY(dest,src,size) wcsncpy_s((dest),(size),(src),_TRUNCATE)
91 #else
92 # define STRNCPY(dest,src,size) wcsncpy((dest),(src),(size))
93 #endif
94
95
96 /*****************************************************************************
97 * Open directory stream DIRNAME for read and return a pointer to the
98 * internal working area that is used to retrieve individual directory
99 * entries.
100 */
101 static _WDIR *_wopendir(const wchar_t *dirname)
102 {
103 _WDIR *dirp;
104 assert (dirname != NULL);
105 assert (wcslen (dirname) < MAX_PATH);
106
107 /* construct new _WDIR structure */
108 dirp = (_WDIR*) malloc (sizeof (struct _WDIR));
109 if (dirp != NULL) {
110 wchar_t *p;
111
112 /* take directory name... */
113 STRNCPY (dirp->patt, dirname, sizeof(dirp->patt));
114 dirp->patt[MAX_PATH] = '\0';
115
116 /* ... and append search pattern to it */
117 p = wcschr (dirp->patt, '\0');
118 if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') {
119 *p++ = '\\';
120 }
121 *p++ = '*';
122 *p = '\0';
123
124 /* open stream and retrieve first file */
125 dirp->search_handle = FindFirstFileW (dirp->patt, &dirp->current.data);
126 if (dirp->search_handle == INVALID_HANDLE_VALUE) {
127 /* invalid search pattern? */
128 free (dirp);
129 return NULL;
130 }
@@ -143,11 +142,11 @@
142 * containing the name of the entry in d_name field. Individual directory
143 * entries returned by this very function include regular files,
144 * sub-directories, pseudo-directories "." and "..", but also volume labels,
145 * hidden files and system files may be returned.
146 */
147 static struct _wdirent *_wreaddir(_WDIR *dirp)
148 {
149 assert (dirp != NULL);
150
151 if (dirp->search_handle == INVALID_HANDLE_VALUE) {
152 /* directory stream was opened/rewound incorrectly or ended normally */
@@ -158,11 +157,11 @@
157 if (dirp->cached != 0) {
158 /* a valid directory entry already in memory */
159 dirp->cached = 0;
160 } else {
161 /* read next directory entry from disk */
162 if (FindNextFileW (dirp->search_handle, &dirp->current.data) == FALSE) {
163 /* the very last file has been processed or an error occured */
164 FindClose (dirp->search_handle);
165 dirp->search_handle = INVALID_HANDLE_VALUE;
166 return NULL;
167 }
@@ -181,11 +180,11 @@
180 /*****************************************************************************
181 * Close directory stream opened by opendir() function. Close of the
182 * directory stream invalidates the DIR structure as well as any previously
183 * read directory entry.
184 */
185 static int _wclosedir(_WDIR *dirp)
186 {
187 assert (dirp != NULL);
188
189 /* release search handle */
190 if (dirp->search_handle != INVALID_HANDLE_VALUE) {
@@ -195,36 +194,7 @@
194
195 /* release directory handle */
196 free (dirp);
197 return 0;
198 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
200 #endif /*DIRENT_H*/
201

Keyboard Shortcuts

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