From: Julian Smart Date: Mon, 11 Jun 2001 21:52:58 +0000 (+0000) Subject: Tex2RTF: underscores now only checked for if syntax checking is on. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fd85b0640ea48f66a27e5908930e9f004de698b6 Tex2RTF: underscores now only checked for if syntax checking is on. Removed the MDIS_ALLCHILDSTYLES style again. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/contrib/samples/ogl/ogledit/OGLEditVC.dsp b/contrib/samples/ogl/ogledit/OGLEditVC.dsp index b3ba99c087..3d50830f50 100644 --- a/contrib/samples/ogl/ogledit/OGLEditVC.dsp +++ b/contrib/samples/ogl/ogledit/OGLEditVC.dsp @@ -1,6 +1,5 @@ # Microsoft Developer Studio Project File - Name="OGLEditVC" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 5.00 -# (Actually, generated by MakeProject, (c) Julian Smart, 1998) +# Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Application" 0x0101 @@ -8,23 +7,24 @@ CFG=OGLEditVC - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "OGLEditVC.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "OGLEditVC.mak" CFG="OGLEditVC - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "OGLEditVC - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "OGLEditVC - Win32 Debug" (based on "Win32 (x86) Application") !MESSAGE "OGLEditVC - Win32 Debug DLL" (based on "Win32 (x86) Application") !MESSAGE "OGLEditVC - Win32 Release DLL" (based on "Win32 (x86) Application") -!MESSAGE +!MESSAGE # Begin Project +# PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe @@ -47,8 +47,8 @@ RSC=rc.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -56,7 +56,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib ogl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib,libci.lib,msvcrtd.lib" /out:"Release/ogledit.exe" /libpath:"../../../../lib" /libpath:"../../../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx.lib png.lib zlib.lib jpeg.lib tiff.lib ogl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /nodefaultlib:"msvcrtd.lib" /out:"Release/ogledit.exe" /libpath:"../../../../lib" /libpath:"../../../../contrib/lib" !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug" @@ -72,9 +72,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -82,7 +82,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib ogld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib,libcid.lib,msvcrt.lib" /out:"Debug/ogledit.exe" /pdbtype:sept /libpath:"../../../../lib" /libpath:"../../../../contrib/lib" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wxd.lib pngd.lib zlibd.lib jpegd.lib tiffd.lib ogld.lib /nologo /subsystem:windows /debug /machine:I386 /nodefaultlib:"libcd.lib" /nodefaultlib:"libcid.lib" /nodefaultlib:"msvcrt.lib" /out:"Debug/ogledit.exe" /pdbtype:sept /libpath:"../../../../lib" /libpath:"../../../../contrib/lib" !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug DLL" @@ -98,9 +98,9 @@ LINK32=link.exe # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "../../../../include" /I "../../../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /Yu"wx/wxprec.h" /FD /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../../include" /I "../../../../contrib/include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D DEBUG=1 /D "__WXDEBUG__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /Yu"wx/wxprec.h" /FD /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "_DEBUG" # ADD RSC /l 0x809 /d "_DEBUG" BSC32=bscmake.exe @@ -126,8 +126,8 @@ LINK32=link.exe # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /MD /W3 /GX /O1 /Ob2 /I "../../../../include" /I "../../../../contrib/include" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__WINDOWS__" /D "__WXMSW__" /D "__WIN95__" /D "__WIN32__" /D WINVER=0x0400 /D "STRICT" /D WXUSINGDLL=1 /FD /c # SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 # ADD BASE RSC /l 0x809 /d "NDEBUG" # ADD RSC /l 0x809 /d "NDEBUG" BSC32=bscmake.exe @@ -137,7 +137,7 @@ LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib /nologo /subsystem:windows /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib rpcrt4.lib wsock32.lib winmm.lib wx23_1.lib ogl.lib /nologo /subsystem:windows /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libci.lib" /out:"ReleaseDLL/ogledit.exe" /libpath:"../../../../lib" /libpath:"../../../../contrib/lib" -!ENDIF +!ENDIF # Begin Target @@ -147,7 +147,7 @@ LINK32=link.exe # Name "OGLEditVC - Win32 Release DLL" # Begin Source File -SOURCE=.\ogledit.cpp +SOURCE=.\doc.cpp !IF "$(CFG)" == "OGLEditVC - Win32 Release" @@ -162,32 +162,16 @@ SOURCE=.\ogledit.cpp !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" -!ENDIF +!ENDIF # End Source File # Begin Source File -SOURCE=.\doc.cpp - -!IF "$(CFG)" == "OGLEditVC - Win32 Release" - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug DLL" - -# SUBTRACT BASE CPP /YX /Yc /Yu -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" - -!ENDIF - +SOURCE=.\doc.h # End Source File # Begin Source File -SOURCE=.\palette.cpp +SOURCE=.\ogledit.cpp !IF "$(CFG)" == "OGLEditVC - Win32 Release" @@ -202,52 +186,22 @@ SOURCE=.\palette.cpp !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" -!ENDIF +!ENDIF # End Source File # Begin Source File -SOURCE=.\view.cpp - -!IF "$(CFG)" == "OGLEditVC - Win32 Release" - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug DLL" - -# SUBTRACT BASE CPP /YX /Yc /Yu -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" - -!ENDIF - +SOURCE=.\ogledit.h # End Source File # Begin Source File -SOURCE=.\doc.h - -!IF "$(CFG)" == "OGLEditVC - Win32 Release" - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug DLL" - -# SUBTRACT BASE CPP /YX /Yc /Yu -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" - -!ENDIF - +SOURCE=.\ogledit.rc +# ADD BASE RSC /l 0x809 +# ADD RSC /l 0x809 /i "../../../../include" /i "../../../../contrib/include" # End Source File # Begin Source File -SOURCE=.\ogledit.h +SOURCE=.\palette.cpp !IF "$(CFG)" == "OGLEditVC - Win32 Release" @@ -262,32 +216,16 @@ SOURCE=.\ogledit.h !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" -!ENDIF +!ENDIF # End Source File # Begin Source File SOURCE=.\palette.h - -!IF "$(CFG)" == "OGLEditVC - Win32 Release" - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug" - -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Debug DLL" - -# SUBTRACT BASE CPP /YX /Yc /Yu -# SUBTRACT CPP /YX /Yc /Yu - -!ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" - -!ENDIF - # End Source File # Begin Source File -SOURCE=.\view.h +SOURCE=.\view.cpp !IF "$(CFG)" == "OGLEditVC - Win32 Release" @@ -302,14 +240,12 @@ SOURCE=.\view.h !ELSEIF "$(CFG)" == "OGLEditVC - Win32 Release DLL" -!ENDIF +!ENDIF # End Source File # Begin Source File -SOURCE=.\ogledit.rc -# ADD BASE RSC /l 0x809 -# ADD RSC /l 0x809 /i "../../../../include" /i "../../../../contrib/include" +SOURCE=.\view.h # End Source File # End Target # End Project diff --git a/contrib/samples/ogl/ogledit/OGLEditVC.dsw b/contrib/samples/ogl/ogledit/OGLEditVC.dsw index 402b32e8de..a79f5624b7 100644 --- a/contrib/samples/ogl/ogledit/OGLEditVC.dsw +++ b/contrib/samples/ogl/ogledit/OGLEditVC.dsw @@ -1,4 +1,4 @@ -Microsoft Developer Studio Workspace File, Format Version 5.00 +Microsoft Developer Studio Workspace File, Format Version 6.00 # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! ############################################################################### diff --git a/include/wx/memory.h b/include/wx/memory.h index dab00aecca..e676282b7a 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -28,6 +28,8 @@ #include +// Obsolete +#if 0 #if wxUSE_IOSTREAMH // N.B. BC++ doesn't have istream.h, ostream.h # include @@ -37,6 +39,7 @@ // using namespace std; # endif #endif +#endif #ifdef __WXDEBUG__ @@ -227,8 +230,11 @@ protected: // Traverse the list. static void TraverseList (PmSFV, wxMemStruct *from = NULL); + // Obsolete +#if 0 static wxSTD streambuf *m_streamBuf; static wxSTD ostream *m_debugStream; +#endif static int debugLevel; static bool debugOn; @@ -243,12 +249,15 @@ public: wxDebugContext(void); ~wxDebugContext(void); + // Obsolete +#if 0 static bool HasStream(void) { return (m_debugStream != NULL); }; static wxSTD ostream& GetStream(void) { return *m_debugStream; } static wxSTD streambuf *GetStreamBuf(void) { return m_streamBuf; } static void SetStream(wxSTD ostream *stream, wxSTD streambuf *buf = NULL); static bool SetFile(const wxString& file); static bool SetStandardError(void); +#endif static int GetLevel(void) { return debugLevel; } static void SetLevel(int level) { debugLevel = level; } diff --git a/include/wx/object.h b/include/wx/object.h index 03a23d01b2..f09a795b6b 100644 --- a/include/wx/object.h +++ b/include/wx/object.h @@ -198,6 +198,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ #endif // Debug/!Debug // Unfortunately Borland seems to need this include. +#if wxUSE_STD_IOSTREAM && (defined(__WXDEBUG__) || wxUSE_DEBUG_CONTEXT) #ifdef __BORLANDC__ #if wxUSE_IOSTREAMH #include @@ -205,6 +206,7 @@ wxObject* WXDLLEXPORT_CTORFN wxConstructorFor##name(void) \ #include #endif #endif +#endif class WXDLLEXPORT wxObjectRefData; diff --git a/src/common/memory.cpp b/src/common/memory.cpp index 6679675ab0..df54d3664c 100644 --- a/src/common/memory.cpp +++ b/src/common/memory.cpp @@ -40,11 +40,14 @@ #include "wx/ioswrap.h" +// Obsolete +#if 0 #if wxUSE_IOSTREAMH #include #else #include #endif +#endif #if !defined(__WATCOMC__) && !(defined(__VMS__) && ( __VMS_VER < 70000000 ) )\ && !defined( __MWERKS__ ) && !defined(__SALFORDC__) @@ -465,8 +468,11 @@ wxMemStruct *wxDebugContext::m_tail = NULL; // wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; // Must initialise these in wxEntry, and then delete them just before wxEntry exits +// Obsolete +#if 0 wxSTD streambuf *wxDebugContext::m_streamBuf = NULL; wxSTD ostream *wxDebugContext::m_debugStream = NULL; +#endif bool wxDebugContext::m_checkPrevious = FALSE; int wxDebugContext::debugLevel = 1; @@ -486,7 +492,7 @@ wxDebugContext::wxDebugContext(void) wxDebugContext::~wxDebugContext(void) { - SetStream(NULL, NULL); +// SetStream(NULL, NULL); } /* @@ -494,6 +500,8 @@ wxDebugContext::~wxDebugContext(void) * between SetFile and SetStream. */ +// Obsolete +#if 0 void wxDebugContext::SetStream(wxSTD ostream *str, wxSTD streambuf *buf) { if (m_debugStream) @@ -548,7 +556,8 @@ bool wxDebugContext::SetStandardError(void) #endif return FALSE; } - +#endif + // 0 /* Work out the positions of the markers by creating an array of 2 markers diff --git a/src/msw/mdi.cpp b/src/msw/mdi.cpp index b0ede88e4e..b021145a27 100644 --- a/src/msw/mdi.cpp +++ b/src/msw/mdi.cpp @@ -1146,7 +1146,12 @@ bool wxMDIClientWindow::CreateClient(wxMDIParentFrame *parent, long style) ccs.hWindowMenu = (HMENU) parent->GetWindowMenu()->GetHMenu(); ccs.idFirstChild = wxFIRST_MDI_CHILD; - DWORD msStyle = MDIS_ALLCHILDSTYLES | WS_VISIBLE | WS_CHILD | + // Note from JACS: please don't restore MDIS_ALLCHILDSTYLES + // without verifying that the OGL Studio sample works. Currently, + // it doesn't, with this style. We have to track it down, but + // I'd rather Studio (and maybe apps like it) didn't completely + // break. + DWORD msStyle = /* MDIS_ALLCHILDSTYLES | */ WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; if ( style & wxHSCROLL ) diff --git a/utils/tex2rtf/src/tex2any.cpp b/utils/tex2rtf/src/tex2any.cpp index 7e8062f12a..8ce3299079 100644 --- a/utils/tex2rtf/src/tex2any.cpp +++ b/utils/tex2rtf/src/tex2any.cpp @@ -581,31 +581,34 @@ bool read_a_line(char *buf) break; } - if (readInVerbatim) + if (checkSyntax) { - // There should NOT be a '\' before the '_' - if ((bufIndex > 0 && (buf[bufIndex-1] == '\\')) && (buf[0] != '%')) + if (readInVerbatim) { - wxString errBuf; - errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); - OnError((char *)errBuf.c_str()); + // There should NOT be a '\' before the '_' + if ((bufIndex > 0 && (buf[bufIndex-1] == '\\')) && (buf[0] != '%')) + { + wxString errBuf; + errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that should NOT have a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); + OnError((char *)errBuf.c_str()); + } } - } - else - { - // There should be a '\' before the '_' - if (bufIndex == 0) + else { - wxString errBuf; - errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); - OnError((char *)errBuf.c_str()); - } - else if ((buf[bufIndex-1] != '\\') && (buf[0] != '%') && // If it is a comment line, then no warnings - (strncmp(buf, "\\input", 6))) // do not report filenames that have underscores in them - { - wxString errBuf; - errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); - OnError((char *)errBuf.c_str()); + // There should be a '\' before the '_' + if (bufIndex == 0) + { + wxString errBuf; + errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); + OnError((char *)errBuf.c_str()); + } + else if ((buf[bufIndex-1] != '\\') && (buf[0] != '%') && // If it is a comment line, then no warnings + (strncmp(buf, "\\input", 6))) // do not report filenames that have underscores in them + { + wxString errBuf; + errBuf.Printf("An underscore ('_') was detected at line %lu inside file %s that may need a '\\' before it.",LineNumbers[CurrentInputIndex], (const char*) currentFileName.c_str()); + OnError((char *)errBuf.c_str()); + } } } buf[bufIndex++] = ch;