From f428c0ed0814bceb23789d6adafbf393b9169d81 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 13 Dec 2004 23:41:47 +0000 Subject: [PATCH] added GIMP_API_VERSION to the generated gimpversion.h. 2004-12-14 Sven Neumann * configure.in: added GIMP_API_VERSION to the generated gimpversion.h. * libgimpbase/gimpenv.c (gimp_toplevel_directory): use GIMP_API_VERSION instead of GIMP_MACRO_VERSION.GIMP_MINOR_VERSION when building a path to test the plug-in executable path against. --- ChangeLog | 8 ++++++++ configure.in | 2 ++ libgimpbase/gimpenv.c | 11 ++++------- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ff9238fe9..6340d0406e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2004-12-14 Sven Neumann + + * configure.in: added GIMP_API_VERSION to the generated gimpversion.h. + + * libgimpbase/gimpenv.c (gimp_toplevel_directory): use + GIMP_API_VERSION instead of GIMP_MACRO_VERSION.GIMP_MINOR_VERSION + when building a path to test the plug-in executable path against. + 2004-12-14 Michael Natterer * tools/pdbgen/pdb/drawable.pdb: added gimp_drawable_sub_thumbnail() diff --git a/configure.in b/configure.in index 043d4511e9..6037f4a997 100644 --- a/configure.in +++ b/configure.in @@ -1525,6 +1525,7 @@ _______EOF #define GIMP_MINOR_VERSION ($gimp_minor_ver) #define GIMP_MICRO_VERSION ($gimp_micro_ver) #define GIMP_VERSION "$gimp_ver" +#define GIMP_API_VERSION "$gimp_api_ver" _______EOF cat >>$outfile <<\_______EOF @@ -1551,6 +1552,7 @@ _______EOF gimp_minor_ver=gimp_minor_version gimp_micro_ver=gimp_micro_version gimp_ver=gimp_version + gimp_api_ver=gimp_api_version ]) AC_CONFIG_FILES([ diff --git a/libgimpbase/gimpenv.c b/libgimpbase/gimpenv.c index 19f9ee37ab..27c1eb6477 100644 --- a/libgimpbase/gimpenv.c +++ b/libgimpbase/gimpenv.c @@ -204,17 +204,14 @@ gimp_toplevel_directory (void) /* If the executable file name is of the format * \bin\*.exe or - * \lib\gimp\GIMP_MAJOR_VERSION.GIMP_MINOR_VERSION\plug-ins\*.exe, - * use . Otherwise, use the directory where the - * executable is. + * \lib\gimp\GIMP_API_VERSION\plug-ins\*.exe, use . + * Otherwise, use the directory where the executable is. */ sep1 = strrchr (filename, '\\'); - *sep1 = '\0'; sep2 = strrchr (filename, '\\'); - if (sep2 != NULL) { if (g_ascii_strcasecmp (sep2 + 1, "bin") == 0) @@ -225,8 +222,8 @@ gimp_toplevel_directory (void) { gchar test[MAX_PATH]; - sprintf (test, "\\lib\\gimp\\%d.%d\\plug-ins", - GIMP_MAJOR_VERSION, GIMP_MINOR_VERSION); + g_snprintf (test, sizeof (test) - 1, + "\\lib\\gimp\\%s\\plug-ins", GIMP_API_VERSION); if (strlen (filename) > strlen (test) && g_ascii_strcasecmp (filename + strlen (filename) - strlen (test),