From e06498763a5265f4b328afb7685d41c0733cc7da Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 5 Mar 2025 19:12:38 +0100 Subject: [PATCH] Fixing issue #1997. --- Changelog | 1 + src/tl/tl/tlString.cc | 3 ++- src/tl/unit_tests/tlStringTests.cc | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index 7af49841b..fdab73e4d 100644 --- a/Changelog +++ b/Changelog @@ -5,6 +5,7 @@ on Edges, Region, EdgePairs and Texts, delivering a pair of containers with selected and unselected objects. * Bug: %GITHUB%/issues/1993 Tiling processor kept layout locks, causing DRC issues with "with_density" +* Bug: %GITHUB%/issues/1997 Can not find a file in Open Recent menu (a string unescaping bug) * Bugfix: 'Save All' was not updating the dirty flag in the inactive tabs * Bugfix: Fixing a crash when editing PCell parameters while the macro editor is open * Bugfix: Fixed a potential Crash on "save all" diff --git a/src/tl/tl/tlString.cc b/src/tl/tl/tlString.cc index 28e597464..d57dee236 100644 --- a/src/tl/tl/tlString.cc +++ b/src/tl/tl/tlString.cc @@ -702,7 +702,8 @@ inline char unescape_char (const char * &cp) { if (safe_isdigit (*cp)) { int c = 0; - while (*cp && safe_isdigit (*cp)) { + unsigned int n = 0; + while (*cp && safe_isdigit (*cp) && n++ < 3) { c = c * 8 + int (*cp - '0'); ++cp; } diff --git a/src/tl/unit_tests/tlStringTests.cc b/src/tl/unit_tests/tlStringTests.cc index 3697ed4f1..634b38e6e 100644 --- a/src/tl/unit_tests/tlStringTests.cc +++ b/src/tl/unit_tests/tlStringTests.cc @@ -504,6 +504,7 @@ TEST(10) EXPECT_EQ (escape_string ("'a\n\003"), "'a\\n\\003"); EXPECT_EQ (escape_string ("'a\n\003"), "'a\\n\\003"); EXPECT_EQ (unescape_string (escape_string ("'a\n\003")), "'a\n\003"); + EXPECT_EQ (unescape_string (escape_string ("'a\n\0031")), "'a\n\0031"); } TEST(11)