summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index c2aaf56..5dc9e3c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -491,6 +491,8 @@ static int open_binaries(char **files, int count)
int result; /* Bilan à retourner */
GStudyProject *project; /* Projet courant à compléter */
int i; /* Boucle de parcours */
+ GContentAttributes *attribs; /* Attributs à lier au contenu */
+ const char *filename; /* Chemin d'accès au contenu */
GBinContent *content; /* Contenu binaire à charger */
result = EXIT_SUCCESS;
@@ -499,16 +501,26 @@ static int open_binaries(char **files, int count)
for (i = 0; i < count && result == EXIT_SUCCESS; i++)
{
- content = g_file_content_new(files[i]);
+ attribs = g_content_attributes_new(files[i]);
+
+ filename = g_content_attributes_get_filename(attribs);
+
+ content = g_file_content_new(filename);
if (content != NULL)
{
+ g_binary_content_set_attributes(content, attribs);
+
g_study_project_discover_binary_content(project, content, !is_batch_mode(), NULL, NULL);
g_object_unref(G_OBJECT(content));
+
}
else
+ {
+ g_object_unref(G_OBJECT(attribs));
result = EXIT_FAILURE;
+ }
}