Commit 6b9b7743 authored by Benoit Mours's avatar Benoit Mours
Browse files

Bug fix : restore the possibility to include ffl in a ffl which was not...

Bug fix : restore the possibility to include ffl in a ffl which was not working anymore since v8r40.
parent 074f8085
Pipeline #182228 passed with stages
in 2 minutes and 11 seconds
......@@ -5883,7 +5883,7 @@ FrFileH* FrFileBreakName(const char *fullName,
/*---------------------------------------first handle cache file and ffl---*/
if(strstr(start, ".ffl") != NULL) {
FrFileOpenFFL(start, &fileHRoot, segList);
if(FrFileOpenFFL(start, &fileHRoot, segList) == NULL) return(NULL);
fileHRoot = FrFileSortByGPS(fileHRoot);
return(fileHRoot);}
 
......@@ -8295,7 +8295,8 @@ FrFileH** FrFileOpenFFL(const char *fullName,
 
fp = fopen(fullName,"r");
if(fp == NULL) {
FrError(3,"FrFileOpenFFL","open ffl file failed");
snprintf(line, 512,"open %s failed", fullName);
FrError(3,"FrFileOpenFFL",line);
return(NULL);}
 
/*----------------------------------------------process file line by line---*/
......@@ -8311,6 +8312,7 @@ FrFileH** FrFileOpenFFL(const char *fullName,
if((end = strstr(start,".ffl")) != NULL) { /*------------- read sub ffl---*/
end[4]='\0';
root = FrFileOpenFFL(start, root, NULL);
if(root == NULL) return(NULL);
continue;}
 
/*---file names with white space must finish by .gwf---*/
......@@ -8320,10 +8322,10 @@ FrFileH** FrFileOpenFFL(const char *fullName,
 
/*---read regular gwf file info---*/
fileH = (FrFileH *) calloc(sizeof(FrFileH), 1);
if(fileH == NULL) return(root);
if(fileH == NULL) return(NULL);
 
fileH->fileName = malloc(end+5-start);
if(fileH->fileName == NULL) return(root);;
if(fileH->fileName == NULL) return(NULL);;
memcpy(fileH->fileName, start, end+4-start);
fileH->fileName[end+4-start] = '\0';
 
......@@ -8346,8 +8348,7 @@ FrFileH** FrFileOpenFFL(const char *fullName,
/*---------------------------- a little bit of cleaning ------*/
fclose(fp);
 
if(*root == NULL) return(NULL);
else return(&((*root)->next));
return(root);
}
/*------------------------------------------------------------FrFileOReopen--*/
void FrFileOReopen(FrFile *oFile,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment