summaryrefslogtreecommitdiffstats
path: root/src/file_txt.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-06-05 10:07:58 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-06-05 10:07:58 +0200
commit365499b706413fe4edde53ac383e25770924f98d (patch)
treeee1634f3db6c229398766ec53863d1e06b570d46 /src/file_txt.c
parent53bc92e1ca559a7081475a27163ad3cc5e88a294 (diff)
PhotoRec: try to distinguish Go .go from Python .py files
Diffstat (limited to 'src/file_txt.c')
-rw-r--r--src/file_txt.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/file_txt.c b/src/file_txt.c
index 371041e..4b69a41 100644
--- a/src/file_txt.c
+++ b/src/file_txt.c
@@ -135,6 +135,8 @@ static const txt_header_t fasttxt_headers[] = {
"emka"
#endif
},
+ /* Source code in go language */
+ { "package main", 12, "go"},
/* ENVI */
{ "ENVI\r\ndescription", 17, "hdr"},
/* Java Application Descriptor
@@ -1258,6 +1260,10 @@ static int header_check_txt(const unsigned char *buffer, const unsigned int buff
ext="java";
#endif
}
+ else if((str=strstr(buffer_lower, "\nimport ("))!=NULL)
+ {
+ ext="go";
+ }
else if((str=strstr(buffer_lower, "\nimport "))!=NULL)
{
str+=8;