From a0c6adc4655e71cb1b1c235c4bb733d233400cf9 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 11 Feb 2012 19:30:57 +0100 Subject: [PATCH] PhotoRec: avoid some html to be identified as .java --- src/file_txt.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/file_txt.c b/src/file_txt.c index b196751f..6182335d 100644 --- a/src/file_txt.c +++ b/src/file_txt.c @@ -1180,18 +1180,6 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff ext="ini"; else if(strstr(buffer_lower, "10 && ind<0.9 && strstr(buffer_lower, "integer")!=NULL) - ext="f"; else if(is_csv>0) ext="csv"; /* Detect LaTeX, C, PHP, JSP, ASP, HTML, C header */ @@ -1210,6 +1198,18 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff ext="asp"; else if(strstr(buffer_lower, sign_html)!=NULL) ext="html"; + else if(strstr(buffer_lower, sign_java1)!=NULL || + strstr(buffer_lower, sign_java3)!=NULL || + strstr(buffer_lower, sign_java4)!=NULL) + { +#ifdef DJGPP + ext="jav"; +#else + ext="java"; +#endif + } + else if(nbrf>10 && ind<0.9 && strstr(buffer_lower, "integer")!=NULL) + ext="f"; else if(strstr(buffer_lower, "\\score {")!=NULL) ext="ly"; /* LilyPond http://lilypond.org*/ else if(strstr(buffer_lower, sign_h)!=NULL && l>50)