Fix parsing of Windows new lines on Mk6 import

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2014-11-15 12:19:12 +02:00 committed by Dirk Hohndel
parent 744e14b450
commit 70939a1d84

7
file.c
View file

@ -423,9 +423,14 @@ char *parse_mkvi_value(const char *haystack, const char *needle)
valueptr += 2;
}
if ((endptr = strstr(lineptr, "\n")) != NULL) {
char terminator = '\n';
if (*(endptr - 1) == '\r') {
--endptr;
terminator = '\r';
}
*endptr = 0;
ret = strdup(valueptr);
*endptr = '\n';
*endptr = terminator;
}
}