]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix in parse headers so it wouldn't always store an empty string
authorRobin Dunn <robin@alldunn.com>
Tue, 8 Feb 2000 21:31:29 +0000 (21:31 +0000)
committerRobin Dunn <robin@alldunn.com>
Tue, 8 Feb 2000 21:31:29 +0000 (21:31 +0000)
for each header value.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/http.cpp

index 26820e2f02a81f9acc36edd896ce2bc7447a28c8..7d24b92f3ef1c9afbea47f2f7ea17d5b3265b145 100644 (file)
@@ -142,13 +142,8 @@ bool wxHTTP::ParseHeaders()
     if (line.Length() == 0)
       break;
 
-    tokenzr.SetString(line, " :\t\n\r");
-    if (!tokenzr.HasMoreTokens())
-      return FALSE;
-
-    wxString left_str = tokenzr.GetNextToken();
-    wxString *str = new wxString(tokenzr.GetNextToken());
-
+       wxString left_str = line.BeforeFirst(':');
+       wxString *str = new wxString(line.AfterFirst(':').Strip(wxString::both));
     left_str.MakeUpper();
 
     m_headers.Append(left_str, (wxObject *) str);