m_MapList = NULL;
m_BrowserName = WXEXTHELP_DEFAULTBROWSER;
m_BrowserIsNetscape = WXEXTHELP_DEFAULTBROWSER_IS_NETSCAPE;
+ m_NumOfEntries = 0;
char *browser = getenv(WXEXTHELP_ENVVAR_BROWSER);
if(browser)
bool
-wxExtHelpController::LoadFile(const wxString& ifile = "")
+wxExtHelpController::LoadFile(const wxString& ifile)
{
wxString mapFile, file, url, doc;
int id,i,len;
file = ifile;
if(! wxIsAbsolutePath(file))
{
- file = wxGetWorkingDirectory();
+ char* f = wxGetWorkingDirectory();
+ file = f;
+ delete[] f; // wxGetWorkingDirectory returns new memory
file << WXEXTHELP_SEPARATOR << ifile;
}
else
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] !=
m_MapList->Append(new wxExtHelpMapEntry(id,url,doc));
m_NumOfEntries++;
}
- else
- perror("");
}while(! feof(input));
fclose(input);