Fossil SCM
Experimental fix to make '%!S' in hyperlinks stop truncating things that are not check-in identifiers. This should probably be optimzied by refactoring the surrounding code to avoid calculating the length more than once.
Commit
7eba14d1e2696fa234840ee8cde24ba0de9176f888a49a92b156c68f43b5106c
Parent
eddd6b4ad5d1583…
1 file changed
+1
-1
+1
-1
| --- src/printf.c | ||
| +++ src/printf.c | ||
| @@ -707,11 +707,11 @@ | ||
| 707 | 707 | bufpt = va_arg(ap,char*); |
| 708 | 708 | if( bufpt==0 ){ |
| 709 | 709 | bufpt = ""; |
| 710 | 710 | }else if( xtype==etDYNSTRING ){ |
| 711 | 711 | zExtra = bufpt; |
| 712 | - }else if( xtype==etSTRINGID ){ | |
| 712 | + }else if( xtype==etSTRINGID && validate16(bufpt, -1) ){ | |
| 713 | 713 | precision = hash_digits(flag_altform2); |
| 714 | 714 | } |
| 715 | 715 | length = StrNLen32(bufpt, limit); |
| 716 | 716 | if( precision>=0 && precision<length ) length = precision; |
| 717 | 717 | break; |
| 718 | 718 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -707,11 +707,11 @@ | |
| 707 | bufpt = va_arg(ap,char*); |
| 708 | if( bufpt==0 ){ |
| 709 | bufpt = ""; |
| 710 | }else if( xtype==etDYNSTRING ){ |
| 711 | zExtra = bufpt; |
| 712 | }else if( xtype==etSTRINGID ){ |
| 713 | precision = hash_digits(flag_altform2); |
| 714 | } |
| 715 | length = StrNLen32(bufpt, limit); |
| 716 | if( precision>=0 && precision<length ) length = precision; |
| 717 | break; |
| 718 |
| --- src/printf.c | |
| +++ src/printf.c | |
| @@ -707,11 +707,11 @@ | |
| 707 | bufpt = va_arg(ap,char*); |
| 708 | if( bufpt==0 ){ |
| 709 | bufpt = ""; |
| 710 | }else if( xtype==etDYNSTRING ){ |
| 711 | zExtra = bufpt; |
| 712 | }else if( xtype==etSTRINGID && validate16(bufpt, -1) ){ |
| 713 | precision = hash_digits(flag_altform2); |
| 714 | } |
| 715 | length = StrNLen32(bufpt, limit); |
| 716 | if( precision>=0 && precision<length ) length = precision; |
| 717 | break; |
| 718 |