MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / output_html_string

Function output_html_string

modules/dasSQLITE/sqlite/shell.c:17015–17044  ·  view source on GitHub ↗

** Output the given string with characters that are special to ** HTML escaped. */

Source from the content-addressed store, hash-verified

17013** HTML escaped.
17014*/
17015static void output_html_string(FILE *out, const char *z){
17016 int i;
17017 if( z==0 ) z = "";
17018 while( *z ){
17019 for(i=0; z[i]
17020 && z[i]!='<'
17021 && z[i]!='&'
17022 && z[i]!='>'
17023 && z[i]!='\"'
17024 && z[i]!='\'';
17025 i++){}
17026 if( i>0 ){
17027 utf8_printf(out,"%.*s",i,z);
17028 }
17029 if( z[i]=='<' ){
17030 raw_printf(out,"&lt;");
17031 }else if( z[i]=='&' ){
17032 raw_printf(out,"&amp;");
17033 }else if( z[i]=='>' ){
17034 raw_printf(out,"&gt;");
17035 }else if( z[i]=='\"' ){
17036 raw_printf(out,"&quot;");
17037 }else if( z[i]=='\'' ){
17038 raw_printf(out,"&#39;");
17039 }else{
17040 break;
17041 }
17042 z += i + 1;
17043 }
17044}
17045
17046/*
17047** If a field contains any character identified by a 1 in the following

Callers 1

shell_callbackFunction · 0.85

Calls 1

utf8_printfFunction · 0.85

Tested by

no test coverage detected