Bugfix for diff hunks beginning with a + line. These do not normally occur in git diff output, but other-hunk generation when splitting can produce them. For example, if a hunk looks like @@ -3866,6 +3863,27 @@ static void show_playlist(void) } } +static void show_info(CD *cd, TG *tg) +{ + void tg_chain(TG *tg) + { if (!tg || !tg->parent) return; + tg_chain(tg->parent); + scroll_space("%s",tg->text); + } + + scroll_space(cd->text); + tg_chain(tg); +} + +static void reset_pending_playlist(void) +{ + int i; + + send_player_head(PLAYER_M2P_FLUSH_PENDING); + for (i=1;icd,playlist.v[i]->tg); + ignore_done_to_flush = 1; +} + static void dl_cds_init(void) { cdvlist.dn = 0; and the user splits off the addition of show_info() as the first part, the generated second part looks like @@ -3866,15 +3863,27 (split @@ -3866,6 +3863,27) + } + } + + static void show_info(CD *cd, TG *tg) + { + void tg_chain(TG *tg) + { if (!tg || !tg->parent) return; + tg_chain(tg->parent); + scroll_space("%s",tg->text); } + + scroll_space(cd->text); + tg_chain(tg); } static void reset_pending_playlist(void) { int i; which tickles this bug. We might be able to get away with just arranging for diff generation to never produce such hunks, but I prefer to make the application code robust in the face of them rather than just hoping they can never occur.