Index: branches/ariel/xmldumps-backup/mwbzutils/recompressxml.c |
— | — | @@ -142,7 +142,7 @@ |
143 | 143 | |
144 | 144 | char *pageTitle = NULL; |
145 | 145 | int pageId = 0; |
146 | | - enum States{WantPage,WantPageTitle,WantPageId}; |
| 146 | + enum States{WantPage,WantPageTitle,WantPageId,FoundCompletePageInfo}; |
147 | 147 | int state = WantPage; |
148 | 148 | |
149 | 149 | /* init bzip compression stuff */ |
— | — | @@ -189,8 +189,10 @@ |
190 | 190 | } |
191 | 191 | pageId = hasId(inBuf); |
192 | 192 | if (pageId) { |
193 | | - state = WantPage; |
| 193 | + state = FoundCompletePageInfo; |
194 | 194 | } |
| 195 | + } |
| 196 | + if (state == FoundCompletePageInfo) { |
195 | 197 | if (indexcompressed) { |
196 | 198 | if (verbose) { |
197 | 199 | fprintf(stderr,"writing line to compressed index file\n"); |
— | — | @@ -214,6 +216,7 @@ |
215 | 217 | } |
216 | 218 | fprintf(indexfd,"%d:%d:%s\n",fileOffset,pageId,pageTitle); |
217 | 219 | } |
| 220 | + state = WantPage; |
218 | 221 | pageId = 0; |
219 | 222 | pageTitle = NULL; |
220 | 223 | } |