commit c40a43342f876bc8a018d210b3cde6c5987e35c7
parent 431e0127dd76043d035e38e115b163210a2de2ed
Author: nibo <nibo@relim.de>
Date: Mon, 9 Sep 2024 21:31:02 +0200
Ignore '\r' in parser
This means that we can now parse
text files coming from windows.
Diffstat:
3 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -30,4 +30,5 @@ install: all lib
uninstall:
rm ${PREFIX}/bin/lorid
rm ${PREFIX}/lib/liblorid.so*
+ rm ${PREFIX}/include/lorid.h
.PHONY: all debug clean fontconfig parser lib install uninstall
diff --git a/chordpro.c b/chordpro.c
@@ -2082,6 +2082,9 @@ struct ChoSong **cho_songs_parse(FILE *fp, struct Config *config)
read = fread(&buf, 1, 1, fp);
if (read == 1) {
// printf("state: %s, prev_state: %s, prev_buf: %c, buf: %c\n", cho_state_to_string(state), cho_state_to_string(prev_state), prev_buf, buf);
+ if (buf == '\r') {
+ continue;
+ }
switch (state) {
case STATE_LYRICS:
if (prev_buf == '\n' && buf == '#') {
diff --git a/todo b/todo
@@ -20,3 +20,4 @@ break lines when too long
render in two or more columns
find better name fore PrintableItem, TextAbove
+consider freeing memory in case of errors