]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed bug for empty lists
authorKarsten Ballüder <ballueder@usa.net>
Sun, 22 Nov 1998 19:45:43 +0000 (19:45 +0000)
committerKarsten Ballüder <ballueder@usa.net>
Sun, 22 Nov 1998 19:45:43 +0000 (19:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1018 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/generic/helpext.cpp

index caf3afba317cc99515968065079d436ba434d3ea..60933b44d60b8bafad333b1fef463fddf25336e2 100644 (file)
@@ -52,6 +52,7 @@ wxExtHelpController::wxExtHelpController(void)
    m_MapList = NULL;
    m_BrowserName = WXEXTHELP_DEFAULTBROWSER;
    m_BrowserIsNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE;
+   m_NumOfEntries = 0;
 
    char *browser = getenv(WXEXTHELP_ENVVAR_BROWSER);
    if(browser)
@@ -150,7 +151,7 @@ wxExtHelpController::LoadFile(const wxString& ifile = "")
             buffer[len-1] = '\0'; // cut of trailing newline
          if(sscanf(buffer,"%d", &id) != 1)
             break; // error
-         for(i=0; isdigit(buffer[i])||isspace(buffer[i]); i++)
+         for(i=0; isdigit(buffer[i])||isspace(buffer[i])||buffer[i]=='-'; i++)
             ; // find begin of URL
          url = "";
          while(buffer[i] && ! isspace(buffer[i]) && buffer[i] !=
@@ -164,8 +165,6 @@ wxExtHelpController::LoadFile(const wxString& ifile = "")
          m_MapList->Append(new wxExtHelpMapEntry(id,url,doc));
          m_NumOfEntries++;
       }
-      else
-         perror("");
    }while(! feof(input));
    fclose(input);