Fossil SCM
merge trunk
Commit
0387251bd3521cd7969bd1420fca426f9bfcac5d
Parent
c0378084774ea24…
16 files changed
+25
-2
+11
-11
+11
-11
+1
-1
+1
-1
+7
-2
+19
-1
+8
-18
+1
-1
+1
-1
+9
-2
+1
-1
+1
-1
+6
-20
+2
-2
+28
-58
+25
-2
| --- src/file.c | ||
| +++ src/file.c | ||
| @@ -580,11 +580,11 @@ | ||
| 580 | 580 | #ifdef _WIN32 |
| 581 | 581 | char *zPwdUtf8; |
| 582 | 582 | int nPwd; |
| 583 | 583 | int i; |
| 584 | 584 | wchar_t zPwd[2000]; |
| 585 | - if( _wgetcwd(zPwd, sizeof(zPwd)-1)==0 ){ | |
| 585 | + if( _wgetcwd(zPwd, sizeof(zPwd)/sizeof(zPwd[0])-1)==0 ){ | |
| 586 | 586 | fossil_fatal("cannot find the current working directory."); |
| 587 | 587 | } |
| 588 | 588 | zPwdUtf8 = fossil_unicode_to_utf8(zPwd); |
| 589 | 589 | nPwd = strlen(zPwdUtf8); |
| 590 | 590 | if( nPwd > nBuf-1 ){ |
| @@ -1003,10 +1003,34 @@ | ||
| 1003 | 1003 | rc = blob_compare(&onDisk, pContent); |
| 1004 | 1004 | blob_reset(&onDisk); |
| 1005 | 1005 | return rc==0; |
| 1006 | 1006 | } |
| 1007 | 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 | + | |
| 1008 | 1032 | |
| 1009 | 1033 | /************************************************************************** |
| 1010 | 1034 | ** The following routines translate between MBCS and UTF8 on windows. |
| 1011 | 1035 | ** Since everything is always UTF8 on unix, these routines are no-ops |
| 1012 | 1036 | ** there. |
| @@ -1029,11 +1053,10 @@ | ||
| 1029 | 1053 | /* |
| 1030 | 1054 | ** Translate Unicode to UTF8. Return a pointer to the translated text. |
| 1031 | 1055 | ** Call fossil_mbcs_free() to deallocate any memory used to store the |
| 1032 | 1056 | ** returned pointer when done. |
| 1033 | 1057 | */ |
| 1034 | -#undef fossil_unicode_to_utf8 | |
| 1035 | 1058 | char *fossil_unicode_to_utf8(const void *zUnicode){ |
| 1036 | 1059 | #ifdef _WIN32 |
| 1037 | 1060 | int nByte = WideCharToMultiByte(CP_UTF8, 0, zUnicode, -1, 0, 0, 0, 0); |
| 1038 | 1061 | char *zUtf = sqlite3_malloc( nByte ); |
| 1039 | 1062 | if( zUtf==0 ){ |
| 1040 | 1063 |
| --- 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 @@ | ||
| 607 | 607 | @ <div class="sectionmenu"> |
| 608 | 608 | showDiff = g.zPath[0]!='c'; |
| 609 | 609 | if( db_get_boolean("show-version-diffs", 0)==0 ){ |
| 610 | 610 | showDiff = !showDiff; |
| 611 | 611 | if( showDiff ){ |
| 612 | - @ %z(xhref("class='button'","%R/vinfo/%T",zName)) | |
| 612 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName)) | |
| 613 | 613 | @ hide diffs</a> |
| 614 | 614 | if( sideBySide ){ |
| 615 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) | |
| 615 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) | |
| 616 | 616 | @ unified diffs</a> |
| 617 | 617 | }else{ |
| 618 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) | |
| 618 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) | |
| 619 | 619 | @ side-by-side diffs</a> |
| 620 | 620 | } |
| 621 | 621 | }else{ |
| 622 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) | |
| 622 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) | |
| 623 | 623 | @ show unified diffs</a> |
| 624 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) | |
| 624 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) | |
| 625 | 625 | @ show side-by-side diffs</a> |
| 626 | 626 | } |
| 627 | 627 | }else{ |
| 628 | 628 | if( showDiff ){ |
| 629 | - @ %z(xhref("class='button'","%R/ci/%T",zName))hide diffs</a> | |
| 629 | + @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide diffs</a> | |
| 630 | 630 | if( sideBySide ){ |
| 631 | - @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName)) | |
| 631 | + @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName)) | |
| 632 | 632 | @ unified diffs</a> |
| 633 | 633 | }else{ |
| 634 | - @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName)) | |
| 634 | + @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName)) | |
| 635 | 635 | @ side-by-side diffs</a> |
| 636 | 636 | } |
| 637 | 637 | }else{ |
| 638 | - @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName)) | |
| 638 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName)) | |
| 639 | 639 | @ show unified diffs</a> |
| 640 | - @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName)) | |
| 640 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName)) | |
| 641 | 641 | @ show side-by-side diffs</a> |
| 642 | 642 | } |
| 643 | 643 | } |
| 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)) | |
| 645 | 645 | @ patch</a></div> |
| 646 | 646 | db_prepare(&q, |
| 647 | 647 | "SELECT name," |
| 648 | 648 | " mperm," |
| 649 | 649 | " (SELECT uuid FROM blob WHERE rid=mlink.pid)," |
| 650 | 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 diffs</a> |
| 614 | if( sideBySide ){ |
| 615 | @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) |
| 616 | @ unified diffs</a> |
| 617 | }else{ |
| 618 | @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) |
| 619 | @ side-by-side diffs</a> |
| 620 | } |
| 621 | }else{ |
| 622 | @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) |
| 623 | @ show unified diffs</a> |
| 624 | @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) |
| 625 | @ show side-by-side diffs</a> |
| 626 | } |
| 627 | }else{ |
| 628 | if( showDiff ){ |
| 629 | @ %z(xhref("class='button'","%R/ci/%T",zName))hide diffs</a> |
| 630 | if( sideBySide ){ |
| 631 | @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName)) |
| 632 | @ unified diffs</a> |
| 633 | }else{ |
| 634 | @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName)) |
| 635 | @ side-by-side diffs</a> |
| 636 | } |
| 637 | }else{ |
| 638 | @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName)) |
| 639 | @ show unified diffs</a> |
| 640 | @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName)) |
| 641 | @ show side-by-side 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 diffs</a> |
| 614 | if( sideBySide ){ |
| 615 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) |
| 616 | @ unified diffs</a> |
| 617 | }else{ |
| 618 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) |
| 619 | @ side-by-side diffs</a> |
| 620 | } |
| 621 | }else{ |
| 622 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) |
| 623 | @ show unified diffs</a> |
| 624 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) |
| 625 | @ show side-by-side diffs</a> |
| 626 | } |
| 627 | }else{ |
| 628 | if( showDiff ){ |
| 629 | @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide diffs</a> |
| 630 | if( sideBySide ){ |
| 631 | @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName)) |
| 632 | @ unified diffs</a> |
| 633 | }else{ |
| 634 | @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName)) |
| 635 | @ side-by-side diffs</a> |
| 636 | } |
| 637 | }else{ |
| 638 | @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName)) |
| 639 | @ show unified diffs</a> |
| 640 | @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName)) |
| 641 | @ show side-by-side 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 @@ | ||
| 607 | 607 | @ <div class="sectionmenu"> |
| 608 | 608 | showDiff = g.zPath[0]!='c'; |
| 609 | 609 | if( db_get_boolean("show-version-diffs", 0)==0 ){ |
| 610 | 610 | showDiff = !showDiff; |
| 611 | 611 | if( showDiff ){ |
| 612 | - @ %z(xhref("class='button'","%R/vinfo/%T",zName)) | |
| 612 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T",zName)) | |
| 613 | 613 | @ hide diffs</a> |
| 614 | 614 | if( sideBySide ){ |
| 615 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) | |
| 615 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) | |
| 616 | 616 | @ unified diffs</a> |
| 617 | 617 | }else{ |
| 618 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) | |
| 618 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) | |
| 619 | 619 | @ side-by-side diffs</a> |
| 620 | 620 | } |
| 621 | 621 | }else{ |
| 622 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) | |
| 622 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) | |
| 623 | 623 | @ show unified diffs</a> |
| 624 | - @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) | |
| 624 | + @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) | |
| 625 | 625 | @ show side-by-side diffs</a> |
| 626 | 626 | } |
| 627 | 627 | }else{ |
| 628 | 628 | if( showDiff ){ |
| 629 | - @ %z(xhref("class='button'","%R/ci/%T",zName))hide diffs</a> | |
| 629 | + @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide diffs</a> | |
| 630 | 630 | if( sideBySide ){ |
| 631 | - @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName)) | |
| 631 | + @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName)) | |
| 632 | 632 | @ unified diffs</a> |
| 633 | 633 | }else{ |
| 634 | - @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName)) | |
| 634 | + @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName)) | |
| 635 | 635 | @ side-by-side diffs</a> |
| 636 | 636 | } |
| 637 | 637 | }else{ |
| 638 | - @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName)) | |
| 638 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName)) | |
| 639 | 639 | @ show unified diffs</a> |
| 640 | - @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName)) | |
| 640 | + @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName)) | |
| 641 | 641 | @ show side-by-side diffs</a> |
| 642 | 642 | } |
| 643 | 643 | } |
| 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)) | |
| 645 | 645 | @ patch</a></div> |
| 646 | 646 | db_prepare(&q, |
| 647 | 647 | "SELECT name," |
| 648 | 648 | " mperm," |
| 649 | 649 | " (SELECT uuid FROM blob WHERE rid=mlink.pid)," |
| 650 | 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 diffs</a> |
| 614 | if( sideBySide ){ |
| 615 | @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) |
| 616 | @ unified diffs</a> |
| 617 | }else{ |
| 618 | @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) |
| 619 | @ side-by-side diffs</a> |
| 620 | } |
| 621 | }else{ |
| 622 | @ %z(xhref("class='button'","%R/ci/%T?sbs=0",zName)) |
| 623 | @ show unified diffs</a> |
| 624 | @ %z(xhref("class='button'","%R/ci/%T?sbs=1",zName)) |
| 625 | @ show side-by-side diffs</a> |
| 626 | } |
| 627 | }else{ |
| 628 | if( showDiff ){ |
| 629 | @ %z(xhref("class='button'","%R/ci/%T",zName))hide diffs</a> |
| 630 | if( sideBySide ){ |
| 631 | @ %z(xhref("class='button'","%R/info/%T?sbs=0",zName)) |
| 632 | @ unified diffs</a> |
| 633 | }else{ |
| 634 | @ %z(xhref("class='button'","%R/info/%T?sbs=1",zName)) |
| 635 | @ side-by-side diffs</a> |
| 636 | } |
| 637 | }else{ |
| 638 | @ %z(xhref("class='button'","%R/vinfo/%T?sbs=0",zName)) |
| 639 | @ show unified diffs</a> |
| 640 | @ %z(xhref("class='button'","%R/vinfo/%T?sbs=1",zName)) |
| 641 | @ show side-by-side 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 diffs</a> |
| 614 | if( sideBySide ){ |
| 615 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) |
| 616 | @ unified diffs</a> |
| 617 | }else{ |
| 618 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) |
| 619 | @ side-by-side diffs</a> |
| 620 | } |
| 621 | }else{ |
| 622 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=0",zName)) |
| 623 | @ show unified diffs</a> |
| 624 | @ %z(xhref("class=\"button\"","%R/ci/%T?sbs=1",zName)) |
| 625 | @ show side-by-side diffs</a> |
| 626 | } |
| 627 | }else{ |
| 628 | if( showDiff ){ |
| 629 | @ %z(xhref("class=\"button\"","%R/ci/%T",zName))hide diffs</a> |
| 630 | if( sideBySide ){ |
| 631 | @ %z(xhref("class=\"button\"","%R/info/%T?sbs=0",zName)) |
| 632 | @ unified diffs</a> |
| 633 | }else{ |
| 634 | @ %z(xhref("class=\"button\"","%R/info/%T?sbs=1",zName)) |
| 635 | @ side-by-side diffs</a> |
| 636 | } |
| 637 | }else{ |
| 638 | @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=0",zName)) |
| 639 | @ show unified diffs</a> |
| 640 | @ %z(xhref("class=\"button\"","%R/vinfo/%T?sbs=1",zName)) |
| 641 | @ show side-by-side 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 @@ | ||
| 36 | 36 | #endif |
| 37 | 37 | #ifdef FOSSIL_ENABLE_TCL |
| 38 | 38 | #include "tcl.h" |
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | -#if !defined(_WIN32) | |
| 41 | +#if !defined(_WIN32) || !defined(UNICODE) | |
| 42 | 42 | # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8 |
| 43 | 43 | # define wchar_t char |
| 44 | 44 | # define wmain main |
| 45 | 45 | #endif |
| 46 | 46 | |
| 47 | 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) |
| 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 @@ | ||
| 36 | 36 | #endif |
| 37 | 37 | #ifdef FOSSIL_ENABLE_TCL |
| 38 | 38 | #include "tcl.h" |
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | -#if !defined(_WIN32) | |
| 41 | +#if !defined(_WIN32) || !defined(UNICODE) | |
| 42 | 42 | # define fossil_unicode_to_utf8 fossil_mbcs_to_utf8 |
| 43 | 43 | # define wchar_t char |
| 44 | 44 | # define wmain main |
| 45 | 45 | #endif |
| 46 | 46 | |
| 47 | 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) |
| 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 @@ | ||
| 90 | 90 | ** show what would have happened. |
| 91 | 91 | ** |
| 92 | 92 | ** --case-sensitive BOOL Overwrite the case-sensitive setting. If false, |
| 93 | 93 | ** files whose names differ only in case are taken |
| 94 | 94 | ** to be the same file. |
| 95 | +** | |
| 96 | +** --force | -f Force the merge even if it would be a no-op. | |
| 95 | 97 | */ |
| 96 | 98 | void merge_cmd(void){ |
| 97 | 99 | int vid; /* Current version "V" */ |
| 98 | 100 | int mid; /* Version we are merging from "M" */ |
| 99 | 101 | int pid; /* The pivot version - most recent common ancestor P */ |
| 100 | 102 | int detailFlag; /* True if the --detail option is present */ |
| 101 | 103 | int pickFlag; /* True if the --cherrypick option is present */ |
| 102 | 104 | int backoutFlag; /* True if the --backout option is present */ |
| 103 | 105 | int nochangeFlag; /* True if the --nochange or -n option is present */ |
| 106 | + int forceFlag; /* True if the --force or -f option is present */ | |
| 104 | 107 | const char *zBinGlob; /* The value of --binary */ |
| 105 | 108 | const char *zPivot; /* The value of --baseline */ |
| 106 | 109 | int debugFlag; /* True if --debug is present */ |
| 107 | 110 | int nChng; /* Number of file name changes */ |
| 108 | 111 | int *aChng; /* An array of file name changes */ |
| @@ -125,10 +128,11 @@ | ||
| 125 | 128 | pickFlag = find_option("cherrypick",0,0)!=0; |
| 126 | 129 | backoutFlag = find_option("backout",0,0)!=0; |
| 127 | 130 | debugFlag = find_option("debug",0,0)!=0; |
| 128 | 131 | zBinGlob = find_option("binary",0,1); |
| 129 | 132 | nochangeFlag = find_option("nochange","n",0)!=0; |
| 133 | + forceFlag = find_option("force","f",0)!=0; | |
| 130 | 134 | zPivot = find_option("baseline",0,1); |
| 131 | 135 | capture_case_sensitive_option(); |
| 132 | 136 | if( g.argc!=3 ){ |
| 133 | 137 | usage("VERSION"); |
| 134 | 138 | } |
| @@ -176,12 +180,13 @@ | ||
| 176 | 180 | mid = t; |
| 177 | 181 | } |
| 178 | 182 | if( !is_a_version(pid) ){ |
| 179 | 183 | fossil_fatal("not a version: record #%d", pid); |
| 180 | 184 | } |
| 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"); | |
| 183 | 188 | return; |
| 184 | 189 | } |
| 185 | 190 | if( detailFlag ){ |
| 186 | 191 | print_checkin_description(mid, 12, "merge-from:"); |
| 187 | 192 | print_checkin_description(pid, 12, "baseline:"); |
| 188 | 193 |
| --- 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 @@ | ||
| 11 | 11 | #include <string.h> |
| 12 | 12 | |
| 13 | 13 | int main(int argc, char *argv[]){ |
| 14 | 14 | FILE *m,*u,*v; |
| 15 | 15 | char *z; |
| 16 | - int i, x; | |
| 16 | + int i, x, d; | |
| 17 | 17 | char b[1000]; |
| 18 | 18 | char vx[1000]; |
| 19 | + memset(b,0,sizeof(b)); | |
| 20 | + memset(vx,0,sizeof(vx)); | |
| 19 | 21 | u = fopen(argv[1],"r"); |
| 20 | 22 | fgets(b, sizeof(b)-1,u); |
| 21 | 23 | fclose(u); |
| 22 | 24 | for(z=b; z[0] && z[0]!='\r' && z[0]!='\n'; z++){} |
| 23 | 25 | *z = 0; |
| @@ -51,7 +53,23 @@ | ||
| 51 | 53 | } |
| 52 | 54 | z++; |
| 53 | 55 | } |
| 54 | 56 | for(z=vx; z[0]=='0'; z++){} |
| 55 | 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"); | |
| 56 | 74 | return 0; |
| 57 | 75 | } |
| 58 | 76 |
| --- 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 @@ | ||
| 18 | 18 | ** This file contains code used to rebuild the database. |
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "rebuild.h" |
| 22 | 22 | #include <assert.h> |
| 23 | -#include <dirent.h> | |
| 24 | 23 | #include <errno.h> |
| 25 | 24 | |
| 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 | 25 | /* |
| 36 | 26 | ** Make changes to the stable part of the schema (the part that is not |
| 37 | 27 | ** simply deleted and reconstructed on a rebuild) to bring the schema |
| 38 | 28 | ** up to the latest. |
| 39 | 29 | */ |
| @@ -827,21 +817,21 @@ | ||
| 827 | 817 | /* |
| 828 | 818 | ** Recursively read all files from the directory zPath and install |
| 829 | 819 | ** every file read as a new artifact in the repository. |
| 830 | 820 | */ |
| 831 | 821 | void recon_read_dir(char *zPath){ |
| 832 | - _WDIR *d; | |
| 833 | - struct _wdirent *pEntry; | |
| 822 | + FOSSIL_DIR *d; | |
| 823 | + struct fossil_dirent *pEntry; | |
| 834 | 824 | Blob aContent; /* content of the just read artifact */ |
| 835 | 825 | static int nFileRead = 0; |
| 836 | - wchar_t *zMbcsPath; | |
| 826 | + void *zUnicodePath; | |
| 837 | 827 | char *zUtf8Name; |
| 838 | 828 | |
| 839 | - zMbcsPath = fossil_utf8_to_unicode(zPath); | |
| 840 | - d = _wopendir(zMbcsPath); | |
| 829 | + zUnicodePath = fossil_utf8_to_unicode(zPath); | |
| 830 | + d = fossil_opendir(zUnicodePath); | |
| 841 | 831 | if( d ){ |
| 842 | - while( (pEntry=_wreaddir(d))!=0 ){ | |
| 832 | + while( (pEntry=fossil_readdir(d))!=0 ){ | |
| 843 | 833 | Blob path; |
| 844 | 834 | char *zSubpath; |
| 845 | 835 | |
| 846 | 836 | if( pEntry->d_name[0]=='.' ){ |
| 847 | 837 | continue; |
| @@ -863,16 +853,16 @@ | ||
| 863 | 853 | blob_reset(&aContent); |
| 864 | 854 | free(zSubpath); |
| 865 | 855 | fossil_print("\r%d", ++nFileRead); |
| 866 | 856 | fflush(stdout); |
| 867 | 857 | } |
| 868 | - _wclosedir(d); | |
| 858 | + fossil_closedir(d); | |
| 869 | 859 | }else { |
| 870 | 860 | fossil_panic("encountered error %d while trying to open \"%s\".", |
| 871 | 861 | errno, g.argv[3]); |
| 872 | 862 | } |
| 873 | - fossil_mbcs_free(zMbcsPath); | |
| 863 | + fossil_mbcs_free(zUnicodePath); | |
| 874 | 864 | } |
| 875 | 865 | |
| 876 | 866 | /* |
| 877 | 867 | ** COMMAND: reconstruct* |
| 878 | 868 | ** |
| 879 | 869 |
| --- 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 @@ | ||
| 549 | 549 | ); |
| 550 | 550 | @ <ul> |
| 551 | 551 | while( db_step(&q)==SQLITE_ROW ){ |
| 552 | 552 | const char *zName = db_column_text(&q, 0); |
| 553 | 553 | 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)) | |
| 555 | 555 | @ %h(zName)</a></li> |
| 556 | 556 | }else{ |
| 557 | 557 | @ <li><span class="tagDsp">%h(zName)</span></li> |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 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 |
| --- 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 @@ | ||
| 549 | 549 | ); |
| 550 | 550 | @ <ul> |
| 551 | 551 | while( db_step(&q)==SQLITE_ROW ){ |
| 552 | 552 | const char *zName = db_column_text(&q, 0); |
| 553 | 553 | 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)) | |
| 555 | 555 | @ %h(zName)</a></li> |
| 556 | 556 | }else{ |
| 557 | 557 | @ <li><span class="tagDsp">%h(zName)</span></li> |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 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 |
| --- 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 @@ | ||
| 1 | 1 | /* |
| 2 | +** Copyright © 2011 D. Richard Hipp | |
| 3 | +** Copyright © 2011 Joe Mistachkin | |
| 4 | +** | |
| 2 | 5 | ** This program is free software; you can redistribute it and/or |
| 3 | 6 | ** modify it under the terms of the Simplified BSD License (also |
| 4 | 7 | ** known as the "2-Clause License" or "FreeBSD License".) |
| 5 | -** | |
| 8 | + | |
| 6 | 9 | ** This program is distributed in the hope that it will be useful, |
| 7 | 10 | ** but without any warranty; without even the implied warranty of |
| 8 | 11 | ** merchantability or fitness for a particular purpose. |
| 12 | +** | |
| 13 | +** Author contact information: | |
| 14 | +** [email protected] | |
| 15 | +** http://www.hwaci.com/drh/ | |
| 9 | 16 | ** |
| 10 | 17 | ******************************************************************************* |
| 18 | +** | |
| 11 | 19 | ** This file contains code used to bridge the TH1 and Tcl scripting languages. |
| 12 | 20 | */ |
| 13 | - | |
| 14 | 21 | #include "config.h" |
| 15 | 22 | |
| 16 | 23 | #ifdef FOSSIL_ENABLE_TCL |
| 17 | 24 | |
| 18 | 25 | #include "th.h" |
| 19 | 26 |
| --- 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 @@ | ||
| 48 | 48 | */ |
| 49 | 49 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | 50 | char z[UUID_SIZE+1]; |
| 51 | 51 | shorten_uuid(z, zUuid); |
| 52 | 52 | 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> | |
| 54 | 54 | }else{ |
| 55 | 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 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 |
| --- 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 @@ | ||
| 48 | 48 | */ |
| 49 | 49 | void hyperlink_to_uuid(const char *zUuid){ |
| 50 | 50 | char z[UUID_SIZE+1]; |
| 51 | 51 | shorten_uuid(z, zUuid); |
| 52 | 52 | 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> | |
| 54 | 54 | }else{ |
| 55 | 55 | @ <span class="timelineHistDsp">[%s(z)]</span> |
| 56 | 56 | } |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 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 |
| --- 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 @@ | ||
| 19 | 19 | */ |
| 20 | 20 | #include "config.h" |
| 21 | 21 | #include "vfile.h" |
| 22 | 22 | #include <assert.h> |
| 23 | 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 | 24 | |
| 39 | 25 | /* |
| 40 | 26 | ** The input is guaranteed to be a 40-character well-formed UUID. |
| 41 | 27 | ** Find its rid. |
| 42 | 28 | */ |
| @@ -390,18 +376,18 @@ | ||
| 390 | 376 | ** Any files or directories that match the glob pattern pIgnore are |
| 391 | 377 | ** excluded from the scan. Name matching occurs after the first |
| 392 | 378 | ** nPrefix characters are elided from the filename. |
| 393 | 379 | */ |
| 394 | 380 | void vfile_scan(Blob *pPath, int nPrefix, int allFlag, Glob *pIgnore){ |
| 395 | - _WDIR *d; | |
| 381 | + FOSSIL_DIR *d; | |
| 396 | 382 | int origSize; |
| 397 | 383 | const char *zDir; |
| 398 | - struct _wdirent *pEntry; | |
| 384 | + struct fossil_dirent *pEntry; | |
| 399 | 385 | int skipAll = 0; |
| 400 | 386 | static Stmt ins; |
| 401 | 387 | static int depth = 0; |
| 402 | - wchar_t *zMbcs; | |
| 388 | + void *zMbcs; | |
| 403 | 389 | |
| 404 | 390 | origSize = blob_size(pPath); |
| 405 | 391 | if( pIgnore ){ |
| 406 | 392 | blob_appendf(pPath, "/"); |
| 407 | 393 | if( glob_match(pIgnore, &blob_str(pPath)[nPrefix+1]) ) skipAll = 1; |
| @@ -417,13 +403,13 @@ | ||
| 417 | 403 | } |
| 418 | 404 | depth++; |
| 419 | 405 | |
| 420 | 406 | zDir = blob_str(pPath); |
| 421 | 407 | zMbcs = fossil_utf8_to_unicode(zDir); |
| 422 | - d = _wopendir(zMbcs); | |
| 408 | + d = fossil_opendir(zMbcs); | |
| 423 | 409 | if( d ){ |
| 424 | - while( (pEntry=_wreaddir(d))!=0 ){ | |
| 410 | + while( (pEntry=fossil_readdir(d))!=0 ){ | |
| 425 | 411 | char *zPath; |
| 426 | 412 | char *zUtf8; |
| 427 | 413 | if( pEntry->d_name[0]=='.' ){ |
| 428 | 414 | if( !allFlag ) continue; |
| 429 | 415 | if( pEntry->d_name[1]==0 ) continue; |
| @@ -444,11 +430,11 @@ | ||
| 444 | 430 | db_step(&ins); |
| 445 | 431 | db_reset(&ins); |
| 446 | 432 | } |
| 447 | 433 | blob_resize(pPath, origSize); |
| 448 | 434 | } |
| 449 | - _wclosedir(d); | |
| 435 | + fossil_closedir(d); | |
| 450 | 436 | } |
| 451 | 437 | fossil_mbcs_free(zMbcs); |
| 452 | 438 | |
| 453 | 439 | depth--; |
| 454 | 440 | if( depth==0 ){ |
| 455 | 441 |
| --- 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 @@ | ||
| 58 | 58 | /* |
| 59 | 59 | * Version |
| 60 | 60 | */ |
| 61 | 61 | |
| 62 | 62 | 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 | |
| 65 | 65 | FILEFLAGSMASK 0x3F |
| 66 | 66 | #if defined(_DEBUG) |
| 67 | 67 | FILEFLAGS 0x1L |
| 68 | 68 | #else |
| 69 | 69 | FILEFLAGS 0x0L |
| 70 | 70 |
| --- 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 |
+28
-58
| --- win/include/dirent.h | ||
| +++ win/include/dirent.h | ||
| @@ -61,71 +61,70 @@ | ||
| 61 | 61 | #include <windows.h> |
| 62 | 62 | #include <string.h> |
| 63 | 63 | #include <assert.h> |
| 64 | 64 | |
| 65 | 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 */ | |
| 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 | 76 | int cached; /* Indicates un-processed entry in memory */ |
| 77 | 77 | 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; | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 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); | |
| 83 | +static _WDIR *_wopendir (const wchar_t *dirname); | |
| 84 | +static struct _wdirent *_wreaddir (_WDIR *dirp); | |
| 85 | +static int _wclosedir (_WDIR *dirp); | |
| 87 | 86 | |
| 88 | 87 | |
| 89 | 88 | /* Use the new safe string functions introduced in Visual Studio 2005 */ |
| 90 | 89 | #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) | |
| 92 | 91 | #else |
| 93 | -# define STRNCPY(dest,src,size) strncpy((dest),(src),(size)) | |
| 92 | +# define STRNCPY(dest,src,size) wcsncpy((dest),(src),(size)) | |
| 94 | 93 | #endif |
| 95 | 94 | |
| 96 | 95 | |
| 97 | 96 | /***************************************************************************** |
| 98 | 97 | * Open directory stream DIRNAME for read and return a pointer to the |
| 99 | 98 | * internal working area that is used to retrieve individual directory |
| 100 | 99 | * entries. |
| 101 | 100 | */ |
| 102 | -static DIR *opendir(const char *dirname) | |
| 101 | +static _WDIR *_wopendir(const wchar_t *dirname) | |
| 103 | 102 | { |
| 104 | - DIR *dirp; | |
| 103 | + _WDIR *dirp; | |
| 105 | 104 | assert (dirname != NULL); |
| 106 | - assert (strlen (dirname) < MAX_PATH); | |
| 105 | + assert (wcslen (dirname) < MAX_PATH); | |
| 107 | 106 | |
| 108 | - /* construct new DIR structure */ | |
| 109 | - dirp = (DIR*) malloc (sizeof (struct DIR)); | |
| 107 | + /* construct new _WDIR structure */ | |
| 108 | + dirp = (_WDIR*) malloc (sizeof (struct _WDIR)); | |
| 110 | 109 | if (dirp != NULL) { |
| 111 | - char *p; | |
| 110 | + wchar_t *p; | |
| 112 | 111 | |
| 113 | 112 | /* take directory name... */ |
| 114 | 113 | STRNCPY (dirp->patt, dirname, sizeof(dirp->patt)); |
| 115 | 114 | dirp->patt[MAX_PATH] = '\0'; |
| 116 | 115 | |
| 117 | 116 | /* ... and append search pattern to it */ |
| 118 | - p = strchr (dirp->patt, '\0'); | |
| 117 | + p = wcschr (dirp->patt, '\0'); | |
| 119 | 118 | if (dirp->patt < p && *(p-1) != '\\' && *(p-1) != ':') { |
| 120 | 119 | *p++ = '\\'; |
| 121 | 120 | } |
| 122 | 121 | *p++ = '*'; |
| 123 | 122 | *p = '\0'; |
| 124 | 123 | |
| 125 | 124 | /* 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); | |
| 127 | 126 | if (dirp->search_handle == INVALID_HANDLE_VALUE) { |
| 128 | 127 | /* invalid search pattern? */ |
| 129 | 128 | free (dirp); |
| 130 | 129 | return NULL; |
| 131 | 130 | } |
| @@ -143,11 +142,11 @@ | ||
| 143 | 142 | * containing the name of the entry in d_name field. Individual directory |
| 144 | 143 | * entries returned by this very function include regular files, |
| 145 | 144 | * sub-directories, pseudo-directories "." and "..", but also volume labels, |
| 146 | 145 | * hidden files and system files may be returned. |
| 147 | 146 | */ |
| 148 | -static struct dirent *readdir(DIR *dirp) | |
| 147 | +static struct _wdirent *_wreaddir(_WDIR *dirp) | |
| 149 | 148 | { |
| 150 | 149 | assert (dirp != NULL); |
| 151 | 150 | |
| 152 | 151 | if (dirp->search_handle == INVALID_HANDLE_VALUE) { |
| 153 | 152 | /* directory stream was opened/rewound incorrectly or ended normally */ |
| @@ -158,11 +157,11 @@ | ||
| 158 | 157 | if (dirp->cached != 0) { |
| 159 | 158 | /* a valid directory entry already in memory */ |
| 160 | 159 | dirp->cached = 0; |
| 161 | 160 | } else { |
| 162 | 161 | /* 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) { | |
| 164 | 163 | /* the very last file has been processed or an error occured */ |
| 165 | 164 | FindClose (dirp->search_handle); |
| 166 | 165 | dirp->search_handle = INVALID_HANDLE_VALUE; |
| 167 | 166 | return NULL; |
| 168 | 167 | } |
| @@ -181,11 +180,11 @@ | ||
| 181 | 180 | /***************************************************************************** |
| 182 | 181 | * Close directory stream opened by opendir() function. Close of the |
| 183 | 182 | * directory stream invalidates the DIR structure as well as any previously |
| 184 | 183 | * read directory entry. |
| 185 | 184 | */ |
| 186 | -static int closedir(DIR *dirp) | |
| 185 | +static int _wclosedir(_WDIR *dirp) | |
| 187 | 186 | { |
| 188 | 187 | assert (dirp != NULL); |
| 189 | 188 | |
| 190 | 189 | /* release search handle */ |
| 191 | 190 | if (dirp->search_handle != INVALID_HANDLE_VALUE) { |
| @@ -195,36 +194,7 @@ | ||
| 195 | 194 | |
| 196 | 195 | /* release directory handle */ |
| 197 | 196 | free (dirp); |
| 198 | 197 | return 0; |
| 199 | 198 | } |
| 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 | 199 | |
| 230 | 200 | #endif /*DIRENT_H*/ |
| 231 | 201 |
| --- 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 |