diff --git a/api/tests/integration/ref/formats/smarts.py.out b/api/tests/integration/ref/formats/smarts.py.out index fde12b2821..f42a8b524e 100644 --- a/api/tests/integration/ref/formats/smarts.py.out +++ b/api/tests/integration/ref/formats/smarts.py.out @@ -53,3 +53,5 @@ CC[C+5]CCCCC [#6]-;!@[#6] is ok. smarts_in==smarts_out [#6]-;!@[#6] is ok. json_in==json_out [#6]-;!@[#6] is ok. expected string found in json +#1292 test smarts c:1-2:c(:c:c:c:c:1)-[#6](=[#8])-[#6;X4]-[#6]-2=[#8] +smarts loaded OK diff --git a/api/tests/integration/tests/formats/smarts.py b/api/tests/integration/tests/formats/smarts.py index 3f2de1ac52..d19329d496 100755 --- a/api/tests/integration/tests/formats/smarts.py +++ b/api/tests/integration/tests/formats/smarts.py @@ -174,3 +174,6 @@ def test_smarts_load_save_through_ket(smarts_in, expected_str): test_smarts_load_save_through_ket( "[#6]-;!@[#6]", '"bonds":[{"type":1,"topology":2,"atoms":[0,1]}]' ) +print("#1292 test smarts c:1-2:c(:c:c:c:c:1)-[#6](=[#8])-[#6;X4]-[#6]-2=[#8]") +indigo.loadSmarts("c:1-2:c(:c:c:c:c:1)-[#6](=[#8])-[#6;X4]-[#6]-2=[#8]") +print("smarts loaded OK") diff --git a/core/indigo-core/molecule/src/smiles_loader.cpp b/core/indigo-core/molecule/src/smiles_loader.cpp index 553056bf84..d19c66546c 100644 --- a/core/indigo-core/molecule/src/smiles_loader.cpp +++ b/core/indigo-core/molecule/src/smiles_loader.cpp @@ -1643,6 +1643,9 @@ void SmilesLoader::_parseMolecule() // Without this shift the 9th bond in the second structure is not double _bonds.top() = pending_bond; _bonds.remove(pending_bond_idx); + for (int i = 0; i < _cycles.size(); i++) + if (_cycles[i].pending_bond >= pending_bond_idx) + --_cycles[i].pending_bond; _cycles[number].clear(); continue;