From d1d978ddc401606ba3634c5440d17c5624d623d1 Mon Sep 17 00:00:00 2001
From: Sergey Petrunya <psergey@askmonty.org>
Date: Thu, 8 Oct 2009 01:00:29 +0400
Subject: [PATCH] Fix win/configure.js: now configure.in has
 AM_INIT_AUTOMAKE(mariadb, ...) - Part 2. make it really work.

---
 win/configure.js | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/win/configure.js b/win/configure.js
index 2f6ecbe3d0e..4cb9b9aeeb4 100644
--- a/win/configure.js
+++ b/win/configure.js
@@ -157,11 +157,15 @@ function GetVersion(str)
 {
     var key = "AM_INIT_AUTOMAKE(mysql, ";
     var key2 = "AM_INIT_AUTOMAKE(mariadb, ";
+    var key_len = key.length;
     var pos = str.indexOf(key); //5.0.6-beta)
     if (pos == -1)
+    {
       pos = str.indexOf(key2);
+      key_len= key2.length;
+    }
     if (pos == -1) return null;
-    pos += key.length;
+    pos += key_len;
     var end = str.indexOf(")", pos);
     if (end == -1) return null;
     return str.substring(pos, end);
-- 
2.30.9