shithub: itdec

Download patch

ref: e8304ea686d212ad118f760dc9e6df5167027272
parent: 69b97132c75dc22b44c78db1061ea6828a1cb211
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Wed Dec 9 08:14:58 EST 2020

print song name

--- a/itdec.c
+++ b/itdec.c
@@ -298,6 +298,8 @@
 main(int argc, char **argv)
 {
 	it_engine *ite;
+	char *s;
+	int i;
 
 	ARGBEGIN{
 	case 's':
@@ -313,6 +315,13 @@
 	Music_AutoDetectSoundCard(ite);
 	D_LoadIT(ite, 0);
 	Music_PlaySong(ite, 0);
+	s = (char*)ite->hdr.SongName;
+	for(i = sizeof(ite->hdr.SongName)-1; i >= 0 ; i--){
+		if(s[i] == ' ')
+			s[i] = 0;
+	}
+	if(*s != 0)
+		fprint(2, "%s\n", s);
 	if(pos > 0.0)
 		fprint(2, "time: %g\n", pos);
 	while(ite->PlayMode != 0)