Commit 33770c36 authored by Benoit Mours's avatar Benoit Mours
Browse files

Relax the constrain introduced on v8r40 : when using a single frame file, the...

Relax the constrain introduced on v8r40 : when using a single frame file, the file suffix could be anything and not just .gwf
parent 0d4f3583
Pipeline #271642 passed with stages
in 2 minutes and 6 seconds
......@@ -7,7 +7,7 @@ cmake_minimum_required(VERSION 3.12.0 FATAL_ERROR)
project(
framel
LANGUAGES C
VERSION 8.41.2
VERSION 8.41.3
DESCRIPTION "LIGO/VIRGO frame library"
HOMEPAGE_URL "https://git.ligo.org/virgo/virgoapp/Fr"
)
......
project ('Fr', 'c', version: '8.41.2')
project ('Fr', 'c', version: '8.41.3')
cc = meson.get_compiler ('c')
......
......@@ -5876,6 +5876,7 @@ FrFileH* FrFileBreakName(const char *fullName,
{FrFileH **root, *fileH, *fileHRoot = NULL;
char *start, *gwf, *end;
const char whitespace[] = " \f\n\r\t\v";
size_t slen, lenNoWhiteSpace;
 
if(fullName == NULL) return(NULL);
 
......@@ -5889,6 +5890,27 @@ FrFileH* FrFileBreakName(const char *fullName,
 
if(strstr(start, ".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);
if(fileH == NULL) return(NULL);
fileH->fileName = malloc(lenNoWhiteSpace+1);
if(fileH->fileName == NULL) return(NULL);;
strncpy(fileH->fileName, start, lenNoWhiteSpace);
fileH->fileName[lenNoWhiteSpace] = '\0';
fileH->tStart = -1.;
fileH->length = 0;
fileH->tFirstEvt = -1.;
fileH->tLastEvt = -1;
return(fileH);}
/*---regular file(s); if the there are multiple files with possibly
white space in their name their names must have the suffix .gwf-------*/
root = &fileHRoot;
......
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