From eded1dbd7b29464426db6e9500abd5e59a8d96f8 Mon Sep 17 00:00:00 2001 From: Xiaoqiang Wang Date: Wed, 13 May 2020 20:10:43 +0200 Subject: [PATCH] remove path separator from LIBDIR and TEMPLATEDIR It is more flexible to add path separator when composing path names. --- require.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/require.c b/require.c index 4e94360..1a5c49d 100644 --- a/require.c +++ b/require.c @@ -264,8 +264,8 @@ int requireDebug; #endif -#define LIBDIR "lib/" -#define TEMPLATEDIR "db/" +#define LIBDIR "lib" +#define TEMPLATEDIR "db" #define TOSTR(s) TOSTR2(s) #define TOSTR2(s) #s @@ -744,7 +744,7 @@ static int findLibRelease ( if (version) { *p=0; symname++; /* get "" from "_LibRelease" */ - if ((p = strstr(name, "/" LIBDIR)) != NULL) p[1]=0; /* cut "" before LIBDIR */ + if ((p = strstr(name, "/" LIBDIR "/" )) != NULL) p[1]=0; /* cut "" before LIBDIR */ if (getLibVersion(symname) == NULL) registerModule(symname, version, location); } @@ -793,7 +793,7 @@ static void registerExternalModules() if (version) { *p=0; symname++; /* get "" from "_LibRelease" */ - if ((p = strstr(name, "\\" LIBDIR)) != NULL) p[1]=0; /* cut "" before LIBDIR */ + if ((p = strstr(name, "\\" LIBDIR "\\")) != NULL) p[1]=0; /* cut "" before LIBDIR */ if (getLibVersion(symname) == NULL) registerModule(symname, version, location); } @@ -1433,7 +1433,7 @@ static int require_priv(const char* module, const char* version, const char* arg /* Even if it has no library, at least it has a dep file in the lib dir */ /* filename = "/[dirlen]/[modulediroffs]" */ - if (!TRY_FILE(modulediroffs, "%s/R%s/" LIBDIR "%s/", + if (!TRY_FILE(modulediroffs, "%s/R%s/" LIBDIR "/%s/", currentFilename, epicsRelease, targetArch)) /* filename = "/[dirlen]/[modulediroffs]/R/lib//" */ { @@ -1552,7 +1552,7 @@ static int require_priv(const char* module, const char* version, const char* arg if (requireDebug) printf("require: looking for dependency file\n"); - if (!TRY_FILE(0, "%s/R%s/%n" LIBDIR "%s/%n%s.dep", + if (!TRY_FILE(0, "%s/R%s/%n" LIBDIR "/%s/%n%s.dep", founddir, epicsRelease, &releasediroffs, targetArch, &libdiroffs, module)) /* filename = "/[dirlen]//R/[releasediroffs]/lib//[libdiroffs]/module.dep" */ {