From f79af27fb0164e4733c583d07d3e2f1170e53b4c Mon Sep 17 00:00:00 2001 From: Marco Biasini <marco.biasini@unibas.ch> Date: Thu, 14 Jun 2012 22:06:58 +0200 Subject: [PATCH] fix BZDNG-334 --- modules/conop/src/chemdict_tool.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/modules/conop/src/chemdict_tool.cc b/modules/conop/src/chemdict_tool.cc index 9cb34281e..05e539956 100644 --- a/modules/conop/src/chemdict_tool.cc +++ b/modules/conop/src/chemdict_tool.cc @@ -72,9 +72,11 @@ int main(int argc, char const *argv[]) filtered_istream.push(istream); io::ChemdictParser cdp(filtered_istream, dialect); conop::CompoundLibPtr compound_lib; - if (!strcmp(argv[1], "create")) { - compound_lib=conop::CompoundLib::Create(argv[3]); - } else if (!strcmp(argv[1], "update")) { + bool in_mem=false; + if (!strncmp(argv[1], "create", 6)) { + compound_lib=conop::CompoundLib::Create(":memory:"); + in_mem=true; + } else if (!strncmp(argv[1], "update", 6)) { compound_lib=conop::CompoundLib::Load(argv[3]); } else { PrintUsage(); @@ -84,7 +86,8 @@ int main(int argc, char const *argv[]) return 0; } assert(compound_lib); - conop::CompoundLibPtr in_mem_lib=compound_lib->Copy(":memory:"); + conop::CompoundLibPtr in_mem_lib=in_mem ? compound_lib : + compound_lib->Copy(":memory:"); compound_lib.reset(); cdp.SetCompoundLib(in_mem_lib); cdp.Parse(); -- GitLab