Author: rnewson
Date: Thu Sep 22 20:05:28 2011
New Revision: 1174358

URL: http://svn.apache.org/viewvc?rev=1174358&view=rev
Log:
fix port conversion in vhost

fix port conversion, don't forget to use substr function. spotted by
@rnewson on irc, again. thanks. patch by benoitc.

Modified:
    couchdb/branches/1.1.x/src/couchdb/couch_httpd_vhost.erl

Modified: couchdb/branches/1.1.x/src/couchdb/couch_httpd_vhost.erl
URL: 
http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_httpd_vhost.erl?rev=1174358&r1=1174357&r2=1174358&view=diff
==============================================================================
--- couchdb/branches/1.1.x/src/couchdb/couch_httpd_vhost.erl (original)
+++ couchdb/branches/1.1.x/src/couchdb/couch_httpd_vhost.erl Thu Sep 22 
20:05:28 2011
@@ -360,8 +360,8 @@ split_host_port(HostAsString) ->
             {split_host(HostAsString), '*'};
         N ->
             HostPart = string:substr(HostAsString, 1, N-1), 
-            case (catch erlang:list_to_integer(HostAsString, N+1,
-                        length(HostAsString))) of
+            case (catch erlang:list_to_integer(string:substr(HostAsString,
+                            N+1, length(HostAsString)))) of
                 {'EXIT', _} ->
                     {split_host(HostAsString), '*'};
                 Port ->


Reply via email to