121925
From e943a89efd63dcfb80a0ab8d9a4db37f523f508e Mon Sep 17 00:00:00 2001
121925
From: =?UTF-8?q?V=C3=ADt=20Ondruch?= <vondruch@redhat.com>
121925
Date: Fri, 8 Feb 2013 22:48:41 +0100
121925
Subject: [PATCH] Prevent duplicated paths when empty version string is
121925
 configured.
121925
121925
---
121925
 configure.in |  3 +++
121925
 version.c    | 10 ++++++++++
121925
 2 files changed, 13 insertions(+)
121925
121925
diff --git a/configure.in b/configure.in
121925
index 5850bbf..7604bb8 100644
121925
--- a/configure.in
121925
+++ b/configure.in
121925
@@ -3419,6 +3419,9 @@ unexpand_shvar exec_prefix         prefix
121925
 if test ${RUBY_LIB_VERSION_STYLE+set}; then
121925
     AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION_STYLE, $RUBY_LIB_VERSION_STYLE !<verconf>!)
121925
 else
121925
+    if test "x${ruby_version}" = 'x'; then
121925
+        AC_DEFINE(RUBY_LIB_VERSION_BLANK, 1)
121925
+    fi
121925
     AC_DEFINE_UNQUOTED(RUBY_LIB_VERSION, [$RUBY_LIB_VERSION] !<verconf>!)
121925
 fi
121925
 AC_DEFINE_UNQUOTED(RUBY_EXEC_PREFIX, ${RUBY_EXEC_PREFIX})
121925
diff --git a/version.c b/version.c
121925
index 282960d..54c4513 100644
121925
--- a/version.c
121925
+++ b/version.c
121925
@@ -39,9 +39,15 @@
121925
 #define RUBY_VENDOR_LIB RUBY_LIB_PREFIX"/vendor_ruby"
121925
 #endif
121925
 
121925
+#ifdef RUBY_LIB_VERSION_BLANK
121925
+#define RUBY_LIB                    RUBY_LIB_PREFIX
121925
+#define RUBY_SITE_LIB2              RUBY_SITE_LIB
121925
+#define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB
121925
+#else
121925
 #define RUBY_LIB                    RUBY_LIB_PREFIX  "/"RUBY_LIB_VERSION
121925
 #define RUBY_SITE_LIB2              RUBY_SITE_LIB    "/"RUBY_LIB_VERSION
121925
 #define RUBY_VENDOR_LIB2            RUBY_VENDOR_LIB  "/"RUBY_LIB_VERSION
121925
+#endif
121925
 #ifndef RUBY_ARCH_LIB_FOR
121925
 #define RUBY_ARCH_LIB_FOR(arch)        RUBY_LIB         "/"arch
121925
 #endif
121925
@@ -77,8 +83,10 @@ const char ruby_initial_load_paths[] =
121925
     RUBY_SITE_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
121925
 #endif
121925
     RUBY_SITE_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
121925
+#ifndef RUBY_LIB_VERSION_BLANK
121925
     RUBY_SITE_LIB "\0"
121925
 #endif
121925
+#endif
121925
 
121925
 #ifndef NO_RUBY_VENDOR_LIB
121925
     RUBY_VENDOR_LIB2 "\0"
121925
@@ -86,8 +94,10 @@ const char ruby_initial_load_paths[] =
121925
     RUBY_VENDOR_ARCH_LIB_FOR(RUBY_THINARCH) "\0"
121925
 #endif
121925
     RUBY_VENDOR_ARCH_LIB_FOR(RUBY_SITEARCH) "\0"
121925
+#ifndef RUBY_LIB_VERSION_BLANK
121925
     RUBY_VENDOR_LIB "\0"
121925
 #endif
121925
+#endif
121925
 
121925
     RUBY_LIB "\0"
121925
 #ifdef RUBY_THINARCH
121925
-- 
121925
1.8.1.2
121925