OpenToonz - An open-source full-featured 2D animation creation software
C
Use npos instead of -1. Remove second comment.
Martin van Zijl4e3671fd46e5
diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cppindex 032f5f7a4..862c5ac4e 100644--- a/toonz/sources/common/tsystem/tfilepath.cpp+++ b/toonz/sources/common/tsystem/tfilepath.cpp@@ -606,8 +606,7 @@ std::string TFilePath::getLevelName() const {}//------------------------------------------------------------------------------// es. TFilePath("/pippo/pluto.0001.tif").getLevelName() == "pluto..tif"-// es. TFilePath("/pippo/0001.tif").getLevelName() == "0001.tif"+// es. TFilePath("/pippo/pluto.0001.gif").getLevelName() == "pluto..gif"std::wstring TFilePath::getLevelNameW() const {int i = getLastSlash(m_path); // cerco l'ultimo slash@@ -623,7 +622,8 @@ std::wstring TFilePath::getLevelNameW() const {if (j == i || j - i == 1) // prova.tif o prova..tifreturn str;- if (!checkForSeqNum(type) || !isNumbers(str, i, j) || i == -1) return str;+ if (!checkForSeqNum(type) || !isNumbers(str, i, j) ||+ i == (int)std::wstring::npos) return str;// prova.0001.tifreturn str.erase(i + 1, j - i - 1);}