Skip to content
Snippets Groups Projects
Commit c84792b8 authored by Marco Biasini's avatar Marco Biasini
Browse files

fix BZDNG-334

parent 4e240385
No related branches found
No related tags found
No related merge requests found
......@@ -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,10 +86,11 @@ 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();
in_mem_lib->Copy(argv[3]);
return 0;
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment