diff --git a/src/obidms.c b/src/obidms.c index 710eb20..1c6d1fe 100644 --- a/src/obidms.c +++ b/src/obidms.c @@ -19,6 +19,7 @@ #include #include #include +#include /* : Addted the 28 july 2017 to include basename */ #include "obidms.h" #include "obierrno.h" @@ -160,7 +161,9 @@ int create_dms_infos_file(int dms_file_descriptor, const char* dms_name) return -1; // Create file - infos_file_descriptor = openat(dms_file_descriptor, file_name, O_RDWR | O_CREAT | O_EXCL, 0777); + infos_file_descriptor = openat(dms_file_descriptor, + file_name, + O_RDWR | O_CREAT | O_EXCL, 0777); if (infos_file_descriptor < 0) { obi_set_errno(OBIDMS_UNKNOWN_ERROR); @@ -302,6 +305,7 @@ OBIDMS_p obi_create_dms(const char* dms_path) return NULL; } +/* // Isolate the dms name j = 0; for (i=0; idms_name, dms_path+j); +*/ + strcpy(dms->dms_name, basename(dms_path)); // Build and check the directory name including the relative path complete_dms_path = build_directory_name(dms_path);