Commit d789a9b0 authored by Benoit Mours's avatar Benoit Mours
Browse files

Bug fix: file with a name that contains Bug fix: file with a name that...

Bug fix: file with a name that contains Bug fix: file with a name that contains .cache or .ffl in the middle of the name instead of a suffix could not be opened
parent ae2f7dfb
Pipeline #424393 passed with stages
in 4 minutes and 40 seconds
......@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
project(
framel
LANGUAGES C
VERSION 8.42.1
VERSION 8.42.2
DESCRIPTION "LIGO/VIRGO frame library"
HOMEPAGE_URL "https://git.ligo.org/virgo/virgoapp/Fr"
)
......
project ('Fr', 'c', version: '8.42.1')
project ('Fr', 'c', version: '8.42.2')
cc = meson.get_compiler ('c')
......
......@@ -4,7 +4,7 @@
MYUNAME=${UNAME:-`uname`}
FR_PATH=`pwd`
FR_VERSION=`grep -e " VERSION " ../CMakeLists.txt|cut -c13-23`
MYCC="gcc -fPIC -O -Wall -DFR_PATH=\"${FR_PATH}\" -DFR_VERSION=\"${FR_VERSION}\" -D_XOPEN_SOURCE=700"
MYCC="gcc -g -fPIC -O -Wall -DFR_PATH=\"${FR_PATH}\" -DFR_VERSION=\"${FR_VERSION}\" -D_XOPEN_SOURCE=700"
#--------------- special convention on alpha and Linux
if [ $MYUNAME = "OSF1" ]
......
......@@ -5897,19 +5897,20 @@ FrFileH* FrFileBreakName(const char *fullName,
if(fullName == NULL) return(NULL);
 
start = (char*) fullName + strspn(fullName, whitespace);
lenNoWhiteSpace = strcspn(start, whitespace);
/*---------------------------------------first handle cache file and ffl---*/
if(strstr(start, ".ffl") != NULL) {
if(strstr(start + lenNoWhiteSpace - 4, ".ffl") != NULL) {
if(FrFileOpenFFL(start, &fileHRoot, segList) == NULL) return(NULL);
fileHRoot = FrFileSortByGPS(fileHRoot);
return(fileHRoot);}
 
if(strstr(start, ".cache") != NULL) return(FrFileOpenCacheFile(start));
if(strstr(start + lenNoWhiteSpace - 6, ".cache") != NULL)
return(FrFileOpenCacheFile(start));
 
/*---then the case of single regular file without white space in the name,
except at the end. In this case, the file suffix could be anything----*/
slen = strlen(start);
lenNoWhiteSpace = strcspn(start, whitespace);
 
if(slen == lenNoWhiteSpace + strspn(start+lenNoWhiteSpace, whitespace)) {
fileH = (FrFileH *) calloc(sizeof(FrFileH), 1);
......
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