File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -292,6 +292,7 @@ struct sndh_cursor {
292292 bool (* read )(struct sndh_cursor * cursor );
293293 size_t start ;
294294 size_t bound ;
295+ size_t end ;
295296 } subtag ;
296297
297298 bool hdns ;
Original file line number Diff line number Diff line change @@ -168,12 +168,15 @@ static bool sndh_substrings_subtag(struct sndh_cursor *cursor)
168168 if (!e )
169169 return false;
170170
171+ if (e > cursor -> subtag .end )
172+ cursor -> subtag .end = e ; /* Keep end of last substring */
173+
171174 tag_update (& c [o ], 0 , cursor );
172175
173176 cursor -> offset += 2 ;
174177
175178 if (cursor -> offset == cursor -> subtag .bound )
176- cursor -> offset = cursor -> subtag .bound = e ;
179+ cursor -> offset = cursor -> subtag .bound = cursor -> subtag . end ;
177180
178181 return true;
179182}
@@ -189,6 +192,7 @@ static bool sndh_substrings(struct sndh_cursor *cursor)
189192
190193 cursor -> subtag .start = cursor -> offset - strlen (cursor -> tag -> name );
191194 cursor -> subtag .bound = cursor -> offset + cursor -> subtunes * 2 ;
195+ cursor -> subtag .end = 0 ;
192196
193197 if (cursor -> bound < cursor -> subtag .bound ) {
194198 diag_error (cursor , "tag %s too short" , cursor -> tag -> name );
You can’t perform that action at this time.
0 commit comments