summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-31 17:27:27 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-31 17:27:27 (GMT)
commit2a58fa2124d4bb99c9c134c396c079450b4a8454 (patch)
tree036382a3c36bede991f4df72e787775d9be903e7 /src/main.c
parenta1d2b44c4316be1567b209f0b3d584207c215477 (diff)
Resolved project path before loading.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 94a34f2..f00a61c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -23,6 +23,7 @@
#include <getopt.h>
+#include <limits.h>
#include <locale.h>
#include <stdlib.h>
#include <unistd.h>
@@ -172,6 +173,7 @@ int main(int argc, char **argv)
char *pub; /* Chemin de la clef publique */
bool welcome; /* Affichage de la bienvenue ? */
+ char resolved[PATH_MAX]; /* RĂ©solution de nom de fichier*/
GStudyProject *project; /* Nouveau projet courant */
static struct option long_options[] = {
@@ -325,6 +327,15 @@ int main(int argc, char **argv)
else
{
+ if (prj_filename != NULL)
+ {
+ prj_filename = realpath(prj_filename, resolved);
+
+ if (prj_filename == NULL)
+ LOG_ERROR_N("realpath");
+
+ }
+
if (prj_filename == NULL)
project = g_study_project_new();