From 46cca8c7efab20f43ded5a37ffe10647f5a80c47 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Wed, 1 May 2024 00:40:42 +0200 Subject: [PATCH] moved code to separate function --- src/files.c | 13 +++++++++---- src/files.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/files.c b/src/files.c index 451edb8b..278938ab 100644 --- a/src/files.c +++ b/src/files.c @@ -2675,13 +2675,18 @@ static void ActivateLevelTemplate(void) } } +boolean isLevelsetFilename_BD(char *filename) +{ + return (strSuffixLower(filename, ".bd") || + strSuffixLower(filename, ".bdr") || + strSuffixLower(filename, ".brc") || + strSuffixLower(filename, ".gds")); +} + static boolean checkForPackageFromBasename_BD(char *basename) { // check for native BD level file extensions - if (!strSuffixLower(basename, ".bd") && - !strSuffixLower(basename, ".bdr") && - !strSuffixLower(basename, ".brc") && - !strSuffixLower(basename, ".gds")) + if (!isLevelsetFilename_BD(basename)) return FALSE; // check for standard single-level BD files (like "001.bd") diff --git a/src/files.h b/src/files.h index 8301b781..aab1da88 100644 --- a/src/files.h +++ b/src/files.h @@ -29,6 +29,7 @@ void setElementChangePages(struct ElementInfo *, int); void setElementChangeInfoToDefaults(struct ElementChangeInfo *); void copyElementInfo(struct ElementInfo *, struct ElementInfo *); +boolean isLevelsetFilename_BD(char *); char *getDefaultLevelFilename(int); char *getLocalLevelTemplateFilename(void); char *getGlobalLevelTemplateFilename(void); -- 2.34.1