X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a29912f608e082001ee53b9873323c4bcd71f21..3e418ffc1002c514f0e3e876809c33ae9ad8695b:/utils/tex2rtf/src/texutils.cpp diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index 5de8abcae7..b3b64661b8 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -402,7 +402,11 @@ void WriteTexReferences(char *filename) void ReadTexReferences(char *filename) { - ifstream istr(filename, ios::nocreate | ios::in); + if (!wxFileExists(filename)) + return; + + ifstream istr(filename, ios::in); + if (istr.bad()) return; char label[100]; @@ -565,8 +569,11 @@ void BibReadValue(istream& istr, char *buffer, bool ignoreBraces = TRUE, bool ReadBib(char *filename) { + if (!wxFileExists(filename)) + return FALSE; + char buf[300]; - ifstream istr(filename, ios::nocreate | ios::in); + ifstream istr(filename, ios::in); if (istr.bad()) return FALSE; BibLine = 1; @@ -1283,7 +1290,11 @@ char *RegisterSetting(char *settingName, char *settingValue, bool interactive) bool ReadCustomMacros(char *filename) { - ifstream istr(filename, ios::nocreate | ios::in); + if (!wxFileExists(filename)) + return FALSE; + + ifstream istr(filename, ios::in); + if (istr.bad()) return FALSE; CustomMacroList.Clear();