From 1de381c175aef90dd83e56108979094f9552b540 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Wed, 7 Feb 2018 18:51:39 +0100 Subject: [PATCH] PhotoRec: better .gpx end detection --- src/file_txt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/file_txt.c b/src/file_txt.c index 41520465..59638a5d 100644 --- a/src/file_txt.c +++ b/src/file_txt.c @@ -734,6 +734,12 @@ static int header_check_vbm(const unsigned char *buffer, const unsigned int buff return 1; } +static void file_check_gpx(file_recovery_t *file_recovery) +{ + file_search_footer(file_recovery, "", 6, 0); + file_allow_nl(file_recovery, NL_BARENL|NL_CRLF|NL_BARECR); +} + static void file_check_xml(file_recovery_t *file_recovery) { file_search_footer(file_recovery, ">", 1, 0); @@ -830,6 +836,9 @@ static int header_check_xml(const unsigned char *buffer, const unsigned int buff { /* GPS eXchange Format */ file_recovery_new->extension="gpx"; + file_recovery_new->file_check=&file_check_gpx; + free(buf); + return 1; } else if(strncasecmp(tmp, "