Skip to content

Commit 1917ee4

Browse files
committed
PhotoRec: distinguish .FCStd from .zip files
See #136
1 parent 2759233 commit 1917ee4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/file_zip.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ static const char *extension_bbdoc="bbdoc";
6868
static const char *extension_celtx="celtx";
6969
static const char *extension_docx="docx";
7070
static const char *extension_epub="epub";
71+
static const char *extension_fcstd="FCStd";
7172
static const char *extension_jar="jar";
7273
static const char *extension_kmz="kmz";
7374
static const char *extension_kra="kra";
@@ -324,6 +325,7 @@ static const char *zip_parse_parse_entry_mimetype(const char *mime, const unsign
324325
*ext == extension_celtx ||
325326
*ext == extension_docx ||
326327
*ext == extension_epub ||
328+
*ext == extension_fcstd ||
327329
*ext == extension_indd ||
328330
*ext == extension_jar ||
329331
*ext == extension_kmz ||
@@ -357,6 +359,7 @@ static const char *zip_parse_parse_entry_mimetype(const char *mime, const unsign
357359
*ext == extension_celtx ||
358360
*ext == extension_docx ||
359361
*ext == extension_epub ||
362+
*ext == extension_fcstd ||
360363
*ext == extension_indd ||
361364
*ext == extension_jar ||
362365
*ext == extension_kmz ||
@@ -415,7 +418,7 @@ static int zip_parse_file_entry_fn(file_recovery_t *fr, const char **ext, const
415418
first_filename[len_tmp]='\0';
416419
}
417420
#ifdef DEBUG_ZIP
418-
log_info("%s\n", filename);
421+
log_info("%s (len=%lu)\n", filename, len);
419422
#endif
420423
if(*ext!=NULL)
421424
return 0;
@@ -471,6 +474,8 @@ static int zip_parse_file_entry_fn(file_recovery_t *fr, const char **ext, const
471474
/* Celtx, Screenwriting & Media Pre-production file */
472475
else if(len==9 && memcmp(filename, "local.rdf", 9)==0)
473476
*ext=extension_celtx;
477+
else if(len==12 && memcmp(filename, "Document.xml", 12)==0)
478+
*ext=extension_fcstd;
474479
else if(len==13 && memcmp(filename, "document.json", 13)==0)
475480
*ext=extension_sketch;
476481
else if(len > 16 && memcmp(filename, "atlases/atlas_ID", 16)==0)
@@ -527,6 +532,7 @@ static int zip_parse_file_entry_fn(file_recovery_t *fr, const char **ext, const
527532
*ext == extension_celtx ||
528533
*ext == extension_docx ||
529534
*ext == extension_epub ||
535+
*ext == extension_fcstd ||
530536
*ext == extension_indd ||
531537
*ext == extension_jar ||
532538
*ext == extension_kmz ||
@@ -560,6 +566,7 @@ static int zip_parse_file_entry_fn(file_recovery_t *fr, const char **ext, const
560566
*ext == extension_celtx ||
561567
*ext == extension_docx ||
562568
*ext == extension_epub ||
569+
*ext == extension_fcstd ||
563570
*ext == extension_indd ||
564571
*ext == extension_jar ||
565572
*ext == extension_kmz ||

0 commit comments

Comments
 (0)