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.

mistachkin 2022-07-01 01:44 trunk
Commit 7eba14d1e2696fa234840ee8cde24ba0de9176f888a49a92b156c68f43b5106c
1 file changed +1 -1
+1 -1
--- src/printf.c
+++ src/printf.c
@@ -707,11 +707,11 @@
707707
bufpt = va_arg(ap,char*);
708708
if( bufpt==0 ){
709709
bufpt = "";
710710
}else if( xtype==etDYNSTRING ){
711711
zExtra = bufpt;
712
- }else if( xtype==etSTRINGID ){
712
+ }else if( xtype==etSTRINGID && validate16(bufpt, -1) ){
713713
precision = hash_digits(flag_altform2);
714714
}
715715
length = StrNLen32(bufpt, limit);
716716
if( precision>=0 && precision<length ) length = precision;
717717
break;
718718
--- 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

Keyboard Shortcuts

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