Differences From Artifact [e2a1a658c7]:
- File src/main.c — part of check-in [c19f34cb69] at 2012-08-31 20:46:09 on branch trunk — Revert change [208d67675c]. The policy is to keep the Fossil source code ASCII even if Fossil itself is able to handle non-ASCII source files. Furthermore, the [208d67675c] change broken things. Also backout change [34fcb9634e] since it complicates the C code with unnecessary backslash characters in order to changes single-quotes to double-quotes in the generated HTML and Javascript, which is pointless. (user: drh size: 56659)
To Artifact [ec1f2f7bd9]:
- File
src/main.c
— part of check-in
[06ba3ace24]
at
2012-09-04 08:14:03
on branch trunk
— memory allocated with mprintf should be freed with fossil_free(), not free()
use _wsystem() in stead of system() on Windows.
Use g.argv[0] in stead of fossil_nameofexec() when the full path is not necessary, e.g for "Usage" prints.
(user: jan.nijtmans size: 56757)
| ︙ | |||
572 573 574 575 576 577 578 | 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 | - + + |
#endif
{
if( g.cgiOutput && once ){
once = 0;
cgi_printf("<p class=\"generalError\">%h</p>", z);
cgi_reply();
}else if( !g.fQuiet ){
|
| ︙ | |||
604 605 606 607 608 609 610 | 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 | - + + |
#endif
{
if( g.cgiOutput ){
g.cgiOutput = 0;
cgi_printf("<p class=\"generalError\">%h</p>", z);
cgi_reply();
}else if( !g.fQuiet ){
|
| ︙ | |||
645 646 647 648 649 650 651 | 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 | - + - + |
#endif
{
if( g.cgiOutput ){
g.cgiOutput = 0;
cgi_printf("<p class=\"generalError\">%h</p>", z);
cgi_reply();
}else{
|
| ︙ | |||
671 672 673 674 675 676 677 | 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 | - + - + |
json_warn( FSL_JSON_W_UNKNOWN, z );
}else
#endif
{
if( g.cgiOutput ){
cgi_printf("<p class=\"generalError\">%h</p>", z);
}else{
|
| ︙ | |||
706 707 708 709 710 711 712 | 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | - - - - + + + + + + + + |
int fossil_system(const char *zOrigCmd){
int rc;
#if defined(_WIN32)
/* On windows, we have to put double-quotes around the entire command.
** Who knows why - this is just the way windows works.
*/
char *zNewCmd = mprintf("\"%s\"", zOrigCmd);
|
| ︙ | |||
779 780 781 782 783 784 785 | 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 | - + |
fossil_warning("%s: %s", sqlite_error_code_name(iCode), zErrmsg);
}
/*
** Print a usage comment and quit
*/
void usage(const char *zFormat){
|
| ︙ | |||
940 941 942 943 944 945 946 | 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 | - + |
** %fossil help --test Show test commands only
** %fossil help --aux Show auxiliary commands only
*/
void help_cmd(void){
int rc, idx;
const char *z;
if( g.argc<3 ){
|
| ︙ | |||
979 980 981 982 983 984 985 | 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 | - + |
z = aCmdHelp[idx];
if( z==0 ){
fossil_fatal("no help available for the %s command",
aCommand[idx].zName);
}
while( *z ){
if( *z=='%' && strncmp(z, "%fossil", 7)==0 ){
|
| ︙ | |||
1026 1027 1028 1029 1030 1031 1032 | 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 | - + |
*d++ = *s++;
}
}
*d = 0;
@ <blockquote><pre>
@ %h(z)
@ </pre></blockquote>
|
| ︙ | |||
1685 1686 1687 1688 1689 1690 1691 | 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 | - + |
int i;
int bExists;
while( zPath && zPath[0] ){
while( zPath[0]==':' ) zPath++;
for(i=0; zPath[i] && zPath[i]!=':'; i++){}
zFull = mprintf("%.*s/%s", i, zPath, zBinary);
bExists = file_access(zFull, X_OK);
|
| ︙ |