Index: install.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/sqlsrv/install.inc,v
retrieving revision 1.4
diff -u -p -r1.4 install.inc
--- install.inc	15 Jan 2011 13:37:11 -0000	1.4
+++ install.inc	31 Jan 2011 14:51:47 -0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: install.inc,v 1.4 2011/01/15 13:37:11 damz Exp $
+// $Id: install.inc,v 1.4 2010/07/11 22:17:56 damz Exp $
 
 // Microsoft SQL Server specific install functions
 
@@ -34,19 +34,19 @@ BEGIN
   DECLARE @result varchar(8000)
   DECLARE @end int
   DECLARE @part int
-  SET @end = 1
+  SET @end = 0
   SET @part = 0
   WHILE (@part < @count)
   BEGIN
     SET @end = CHARINDEX(@delimiter, @string, @end + 1)
     IF (@end = 0)
     BEGIN
-      SET @end = LEN(@string)
+      SET @end = LEN(@string) + 1
       BREAK
     END
-    SET @count = @count + 1
+    SET @part = @part + 1
   END
-  SET @result = SUBSTRING(@string, 1, @end)
+  SET @result = SUBSTRING(@string, 1, @end - 1)
   RETURN @result
 END
 EOF
