Differences From Artifact [cb1d44d9e6]:
- File src/printf.c — part of check-in [de0bbcb53c] at 2019-03-16 17:04:55 on branch trunk — Abandon an export to Git if a phantom artifact is encountered on any check-in that is less than one year old. This is a defense against generating an incorrect export from a repository that has an incomplete sync. Shunned artifacts are always ignored, regardless of age. (user: drh size: 38155) [more...]
To Artifact [3d6128552e]:
- File src/printf.c — part of check-in [5e9c1d5e04] at 2019-05-17 13:53:46 on branch trunk — Add the %j formatting directive to the customized printf() inside of Fossil. The %j format generates a string with appropriate backslash escapes so that the string can be part of a Javascript string literal. (user: drh size: 38608) [more...]
| ︙ | ︙ | |||
97 98 99 100 101 102 103 104 105 106 107 108 109 110 | #define etHTTPIZE 18 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 19 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 20 /* The fossil header encoding format. */ #define etPATH 21 /* Path type */ #define etWIKISTR 22 /* Timeline comment text rendered from a char*: %W */ #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ #define etROOT 24 /* String value of g.zTop: %R */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; | > | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | #define etHTTPIZE 18 /* Make text safe for HTTP. "/" encoded as %2f */ #define etURLIZE 19 /* Make text safe for HTTP. "/" not encoded */ #define etFOSSILIZE 20 /* The fossil header encoding format. */ #define etPATH 21 /* Path type */ #define etWIKISTR 22 /* Timeline comment text rendered from a char*: %W */ #define etSTRINGID 23 /* String with length limit for a UUID prefix: %S */ #define etROOT 24 /* String value of g.zTop: %R */ #define etJSONSTR 25 /* String encoded as a JSON string literal: %j */ /* ** An "etByte" is an 8-bit unsigned value. */ typedef unsigned char etByte; |
| ︙ | ︙ | |||
148 149 150 151 152 153 154 155 156 157 158 159 160 161 |
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 'R', 0, 0, etROOT, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'w', 0, 4, etSQLESCAPE3, 0, 0 },
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
| > | 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 |
{ 'h', 0, 4, etHTMLIZE, 0, 0 },
{ 'R', 0, 0, etROOT, 0, 0 },
{ 't', 0, 4, etHTTPIZE, 0, 0 }, /* "/" -> "%2F" */
{ 'T', 0, 4, etURLIZE, 0, 0 }, /* "/" unchanged */
{ 'w', 0, 4, etSQLESCAPE3, 0, 0 },
{ 'F', 0, 4, etFOSSILIZE, 0, 0 },
{ 'S', 0, 4, etSTRINGID, 0, 0 },
{ 'j', 0, 0, etJSONSTR, 0, 0 },
{ 'c', 0, 0, etCHARX, 0, 0 },
{ 'o', 8, 0, etRADIX, 0, 2 },
{ 'u', 10, 0, etRADIX, 0, 0 },
{ 'x', 16, 0, etRADIX, 16, 1 },
{ 'X', 16, 0, etRADIX, 0, 4 },
{ 'f', 0, 1, etFLOAT, 0, 0 },
{ 'e', 0, 1, etEXP, 30, 0 },
|
| ︙ | ︙ | |||
777 778 779 780 781 782 783 784 785 786 787 788 789 790 |
break;
}
case etFOSSILIZE: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zMem = va_arg(ap,char*);
if( zMem==0 ) zMem = "";
zExtra = bufpt = fossilize(zMem, limit);
length = strlen(bufpt);
if( precision>=0 && precision<length ) length = precision;
break;
}
case etWIKISTR: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zWiki = va_arg(ap, char*);
| > > > > > > > > > | 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 |
break;
}
case etFOSSILIZE: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zMem = va_arg(ap,char*);
if( zMem==0 ) zMem = "";
zExtra = bufpt = fossilize(zMem, limit);
length = strlen(bufpt);
if( precision>=0 && precision<length ) length = precision;
break;
}
case etJSONSTR: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zMem = va_arg(ap,char*);
if( zMem==0 ) zMem = "";
zExtra = bufpt = encode_json_string_literal(zMem);
length = strlen(bufpt);
if( precision>=0 && precision<length ) length = precision;
break;
}
case etWIKISTR: {
int limit = flag_alternateform ? va_arg(ap,int) : -1;
char *zWiki = va_arg(ap, char*);
|
| ︙ | ︙ |