This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit d0372038fd2fa815750663a0ecc8471d136f9ee2
Author: Kim Woelders <[email protected]>
AuthorDate: Fri May 13 21:03:49 2022 +0200

    modules: Cosmetics, mostly
---
 src/lib/dynamic_filters.c |  2 +-
 src/lib/file.h            |  3 ++-
 src/lib/loaders.c         | 10 +++++-----
 src/lib/modules.c         | 12 +++++++++++-
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/src/lib/dynamic_filters.c b/src/lib/dynamic_filters.c
index 24c1cc2..ea7ad24 100644
--- a/src/lib/dynamic_filters.c
+++ b/src/lib/dynamic_filters.c
@@ -97,7 +97,7 @@ __imlib_dynamic_filters_init()
 #ifdef FDEBUG
         printf("DEBUG: Loading Filters\n");
 #endif
-        list = __imlib_ListModules(__imlib_PathToFilters(), &num_filters);
+        list = __imlib_ModulesList(__imlib_PathToFilters(), &num_filters);
         for (i = num_filters - 1; i >= 0; i--)
           {
              tptr = NULL;
diff --git a/src/lib/file.h b/src/lib/file.h
index f378bb8..0061194 100644
--- a/src/lib/file.h
+++ b/src/lib/file.h
@@ -46,6 +46,7 @@ int                 __imlib_ItemInList(char **list, int size, char *item);
 
 const char         *__imlib_PathToFilters(void);
 const char         *__imlib_PathToLoaders(void);
-char              **__imlib_ListModules(const char *path, int *num_ret);
+char              **__imlib_ModulesList(const char *path, int *num_ret);
+char               *__imlib_ModuleFind(const char *path, const char *name);
 
 #endif
diff --git a/src/lib/loaders.c b/src/lib/loaders.c
index dd89356..1e44d2e 100644
--- a/src/lib/loaders.c
+++ b/src/lib/loaders.c
@@ -233,7 +233,7 @@ __imlib_LoadAllLoaders(void)
    DP("%s\n", __func__);
 
    /* list all the loaders imlib can find */
-   list = __imlib_ListModules(__imlib_PathToLoaders(), &num);
+   list = __imlib_ModulesList(__imlib_PathToLoaders(), &num);
    /* no loaders? well don't load anything */
    if (!list)
       return;
@@ -266,7 +266,7 @@ __imlib_LookupKnownLoader(const char *format)
    ImlibLoader        *l;
    unsigned int        i;
    const char         *const *exts;
-   char                nbuf[4096];
+   char               *dso;
 
    kl = NULL;
    for (i = 0; i < ARRAY_SIZE(loaders_known); i++)
@@ -284,9 +284,9 @@ __imlib_LookupKnownLoader(const char *format)
    l = NULL;
    if (kl)
      {
-        snprintf(nbuf, sizeof(nbuf), "%s/%s.so", __imlib_PathToLoaders(),
-                 kl->dso);
-        l = __imlib_ProduceLoader(nbuf);
+        dso = __imlib_ModuleFind(__imlib_PathToLoaders(), kl->dso);
+        l = __imlib_ProduceLoader(dso);
+        free(dso);
      }
    DP("%s: '%s' -> '%s': %p\n", __func__, format, kl ? kl->dso : "-", l);
    return l;
diff --git a/src/lib/modules.c b/src/lib/modules.c
index 6d9f29e..14d56b5 100644
--- a/src/lib/modules.c
+++ b/src/lib/modules.c
@@ -81,7 +81,7 @@ _file_is_module(const char *name)
 }
 
 char              **
-__imlib_ListModules(const char *path, int *num_ret)
+__imlib_ModulesList(const char *path, int *num_ret)
 {
    char              **list = NULL, **l;
    char                file[1024], *p;
@@ -113,3 +113,13 @@ __imlib_ListModules(const char *path, int *num_ret)
 
    return list;
 }
+
+char               *
+__imlib_ModuleFind(const char *path, const char *name)
+{
+   char                nbuf[4096];
+
+   snprintf(nbuf, sizeof(nbuf), "%s/%s.so", path, name);
+
+   return strdup(nbuf);
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to