diff --git a/src/OpenColorIO/LookParse.cpp b/src/OpenColorIO/LookParse.cpp index 2b83270e0..0102d17db 100644 --- a/src/OpenColorIO/LookParse.cpp +++ b/src/OpenColorIO/LookParse.cpp @@ -84,6 +84,12 @@ const LookParseResult::Options & LookParseResult::parse(const std::string & look tokens.push_back(t); } + if( vec.size() == 0 ) + { + LookParseResult::Token t; + tokens.push_back(t); + } + m_options.push_back(tokens); } diff --git a/tests/cpu/ParseUtils_tests.cpp b/tests/cpu/ParseUtils_tests.cpp index 2af2ce84b..b46e147d6 100644 --- a/tests/cpu/ParseUtils_tests.cpp +++ b/tests/cpu/ParseUtils_tests.cpp @@ -388,6 +388,10 @@ OCIO_ADD_TEST(ParseUtils, string_vec_to_int_vec) OCIO_ADD_TEST(ParseUtils, split_string_env_style) { StringUtils::StringVec outputvec; + outputvec = OCIO::SplitStringEnvStyle(""); + OCIO_CHECK_EQUAL(0, outputvec.size()); + outputvec.clear(); + outputvec = OCIO::SplitStringEnvStyle("This:is:a:test"); OCIO_CHECK_EQUAL(4, outputvec.size()); OCIO_CHECK_EQUAL("This", outputvec[0]); @@ -485,6 +489,9 @@ OCIO_ADD_TEST(ParseUtils, join_string_env_style) OCIO_CHECK_EQUAL( "This, is, a, test", OCIO::JoinStringEnvStyle(outputvec) ); outputvec.clear(); + OCIO_CHECK_EQUAL( "", OCIO::JoinStringEnvStyle(outputvec) ); + outputvec.clear(); + outputvec = { "This:is", "a:test" }; OCIO_CHECK_EQUAL( "\"This:is\", \"a:test\"", OCIO::JoinStringEnvStyle(outputvec) ); outputvec.clear();