From 93fc52322be3a9e172b217622022c9e586823012 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Fri, 31 Jul 2009 09:24:41 +0200 Subject: [PATCH] PhotoRec: avoid extension with more than 3 letters for DOS/DJGPP version --- src/file_dump.c | 4 ++++ src/file_fh10.c | 4 ++++ src/file_fits.c | 4 ++++ src/file_flac.c | 4 ++++ src/file_indd.c | 4 ++++ src/file_m2ts.c | 4 ++++ src/file_pcap.c | 4 ++++ src/file_vmdk.c | 4 ++++ 8 files changed, 32 insertions(+) diff --git a/src/file_dump.c b/src/file_dump.c index 57307583..1524f506 100644 --- a/src/file_dump.c +++ b/src/file_dump.c @@ -142,7 +142,11 @@ static int header_check_dump(const unsigned char *buffer, const unsigned int buf le32(dump->c_type)==TS_TAPE) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="dmp"; +#else file_recovery_new->extension=file_hint_dump.extension; +#endif return 1; } return 0; diff --git a/src/file_fh10.c b/src/file_fh10.c index a2c3acf5..ea9b2e4a 100644 --- a/src/file_fh10.c +++ b/src/file_fh10.c @@ -62,7 +62,11 @@ static int header_check_fh10(const unsigned char *buffer, const unsigned int buf { reset_file_recovery(file_recovery_new); file_recovery_new->min_filesize=4096; +#ifdef DJGPP + file_recovery_new->extension="fh1"; +#else file_recovery_new->extension=file_hint_fh10.extension; +#endif return 1; } return 0; diff --git a/src/file_fits.c b/src/file_fits.c index 0dd26e80..997000cf 100644 --- a/src/file_fits.c +++ b/src/file_fits.c @@ -76,7 +76,11 @@ static int header_check_fits(const unsigned char *buffer, const unsigned int buf unsigned int i=0; uint64_t naxis_size_max=0; reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="fts"; +#else file_recovery_new->extension=file_hint_fits.extension; +#endif file_recovery_new->min_filesize=2880; file_recovery_new->data_check=&data_check_size; file_recovery_new->file_check=&file_check_size; diff --git a/src/file_flac.c b/src/file_flac.c index 9d0176e7..5ae428f8 100644 --- a/src/file_flac.c +++ b/src/file_flac.c @@ -56,7 +56,11 @@ static int header_check_flac(const unsigned char *buffer, const unsigned int buf if(memcmp(buffer, flac_header, sizeof(flac_header))==0) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="flc"; +#else file_recovery_new->extension=file_hint_flac.extension; +#endif return 1; } return 0; diff --git a/src/file_indd.c b/src/file_indd.c index 19faf817..2d2d1476 100644 --- a/src/file_indd.c +++ b/src/file_indd.c @@ -72,7 +72,11 @@ static int header_check_indd(const unsigned char *buffer, const unsigned int buf if (memcmp(hdr->id,indd_header,sizeof(indd_header))==0) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="ind"; +#else file_recovery_new->extension=file_hint_indd.extension; +#endif file_recovery_new->calculated_file_size=(uint64_t)(1+le32(hdr->blocks))*4096; file_recovery_new->file_check=&file_check_indd; // log_debug("header_check_indd: Guessed length: %lu.\n", indd_file_size); diff --git a/src/file_m2ts.c b/src/file_m2ts.c index 7494b746..e261d2bb 100644 --- a/src/file_m2ts.c +++ b/src/file_m2ts.c @@ -72,7 +72,11 @@ static int header_check_m2ts(const unsigned char *buffer, const unsigned int buf memcmp(&buffer[0xe8], hdmv_header, sizeof(hdmv_header))==0) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="m2t"; +#else file_recovery_new->extension=file_hint_m2ts.extension; +#endif file_recovery_new->min_filesize=192; file_recovery_new->calculated_file_size=192; file_recovery_new->data_check=&data_check_m2ts; diff --git a/src/file_pcap.c b/src/file_pcap.c index e6fb3d67..4c1c2a1d 100644 --- a/src/file_pcap.c +++ b/src/file_pcap.c @@ -56,7 +56,11 @@ static int header_check_pcap(const unsigned char *buffer, const unsigned int buf if(memcmp(buffer, pcap_header, sizeof(pcap_header))==0) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="pcp"; +#else file_recovery_new->extension=file_hint_pcap.extension; +#endif return 1; } return 0; diff --git a/src/file_vmdk.c b/src/file_vmdk.c index ed09d762..0176f5b9 100644 --- a/src/file_vmdk.c +++ b/src/file_vmdk.c @@ -86,7 +86,11 @@ static int header_check_vmdk(const unsigned char *buffer, const unsigned int buf memcmp(buffer,vmdk_header4, sizeof(vmdk_header4))==0) { reset_file_recovery(file_recovery_new); +#ifdef DJGPP + file_recovery_new->extension="vmd"; +#else file_recovery_new->extension=file_hint_vmdk.extension; +#endif return 1; } return 0;