** Output the given string with characters that are special to ** HTML escaped. */
| 17013 | ** HTML escaped. |
| 17014 | */ |
| 17015 | static 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,"<"); |
| 17031 | }else if( z[i]=='&' ){ |
| 17032 | raw_printf(out,"&"); |
| 17033 | }else if( z[i]=='>' ){ |
| 17034 | raw_printf(out,">"); |
| 17035 | }else if( z[i]=='\"' ){ |
| 17036 | raw_printf(out,"""); |
| 17037 | }else if( z[i]=='\'' ){ |
| 17038 | raw_printf(out,"'"); |
| 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 |
no test coverage detected