diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2014-11-15 12:19:12 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-11-15 06:05:22 -0800 |
commit | 70939a1d84730b41224a4dfefed3b6635f1de2e0 (patch) | |
tree | 69a0acf6e0d00a9acd6d455b3566ca9752c40b41 | |
parent | 744e14b4505796a5465c03ee77422aaa4d8cae30 (diff) | |
download | subsurface-70939a1d84730b41224a4dfefed3b6635f1de2e0.tar.gz |
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>
-rw-r--r-- | file.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -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; } } |