commit 4b5ceb43ea45aba10d8f8fbe1defc421486d9f0b
Author: Juergen Spitzmueller <[email protected]>
Date: Wed Aug 6 14:22:39 2025 +0200
Amend b2d2a42f04c
Exit after detecting the wrong column specification
Otherwise we might end up with a corrupted loaded LyX file
---
src/tex2lyx/table.cpp | 5 +++--
src/tex2lyx/tex2lyx.cpp | 4 +++-
src/tex2lyx/tex2lyx.h | 2 +-
3 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/tex2lyx/table.cpp b/src/tex2lyx/table.cpp
index 1dc81496dc..4425e773c5 100644
--- a/src/tex2lyx/table.cpp
+++ b/src/tex2lyx/table.cpp
@@ -514,8 +514,9 @@ void handle_colalign(Parser & p, vector<ColInfo> & colinfo,
string const num = p.verbatim_item();
string const arg = p.verbatim_item();
if (!support::isStrUnsignedInt(num)) {
- warning_message("Ignoring invalid
column specification"
- " '*{" + num + "}{" +
arg + "}'.");
+ error_message("Invalid column
specification"
+ " '*{" + num + "}{" +
arg + "}'.\n"
+ "Cannot proceed!",
true);
break;
}
size_t const n = convert<unsigned int>(num);
diff --git a/src/tex2lyx/tex2lyx.cpp b/src/tex2lyx/tex2lyx.cpp
index 94ad69ab5f..ee3b853e46 100644
--- a/src/tex2lyx/tex2lyx.cpp
+++ b/src/tex2lyx/tex2lyx.cpp
@@ -1138,9 +1138,11 @@ void warning_message(string const & message)
}
-void error_message(string const & message)
+void error_message(string const & message, bool const exit)
{
cerr << "tex2lyx error: " << message << endl;
+ if (exit)
+ throw StopException(EXIT_FAILURE);
}
#ifdef FILEDEBUG
diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h
index 374cb27c08..b8c9dad1dd 100644
--- a/src/tex2lyx/tex2lyx.h
+++ b/src/tex2lyx/tex2lyx.h
@@ -219,7 +219,7 @@ bool tex2lyx(std::string const & infilename,
/// A general warning message that can be silenced with -q
void warning_message(std::string const & message);
/// A general error message
-void error_message(std::string const & message);
+void error_message(std::string const & message, bool const exit = false);
/// A general debug message that outputs if
/// FILEDEBUG is definied
void debug_message(std::string const & message);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs