Fossil SCM

Move loop variable declaration out of for loop for C89 happiness.

rberteig 2016-05-03 07:11
Commit 5a0dbf97ba551d294b24e42cb5cce678d9a0d3cf
1 file changed +2 -1
+2 -1
--- src/wiki.c
+++ src/wiki.c
@@ -137,11 +137,12 @@
137137
** Only allow certain mimetypes through.
138138
** All others become "text/x-fossil-wiki"
139139
*/
140140
const char *wiki_filter_mimetypes(const char *zMimetype){
141141
if( zMimetype!=0 ){
142
- for(int i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
142
+ int i;
143
+ for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
143144
if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
144145
return azStyles[i];
145146
}
146147
}
147148
if( fossil_strcmp(zMimetype, "text/x-markdown")==0
148149
--- src/wiki.c
+++ src/wiki.c
@@ -137,11 +137,12 @@
137 ** Only allow certain mimetypes through.
138 ** All others become "text/x-fossil-wiki"
139 */
140 const char *wiki_filter_mimetypes(const char *zMimetype){
141 if( zMimetype!=0 ){
142 for(int i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
 
143 if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
144 return azStyles[i];
145 }
146 }
147 if( fossil_strcmp(zMimetype, "text/x-markdown")==0
148
--- src/wiki.c
+++ src/wiki.c
@@ -137,11 +137,12 @@
137 ** Only allow certain mimetypes through.
138 ** All others become "text/x-fossil-wiki"
139 */
140 const char *wiki_filter_mimetypes(const char *zMimetype){
141 if( zMimetype!=0 ){
142 int i;
143 for(i=0; i<sizeof(azStyles)/sizeof(azStyles[0]); i+=3){
144 if( fossil_strcmp(zMimetype,azStyles[i+2])==0 ){
145 return azStyles[i];
146 }
147 }
148 if( fossil_strcmp(zMimetype, "text/x-markdown")==0
149

Keyboard Shortcuts

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