aboutsummaryrefslogtreecommitdiff
path: root/src/indexamajig.c
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-10-20 05:43:01 -0700
committerThomas White <taw@physics.org>2012-10-20 05:43:22 -0700
commitd33230479371986bd58fc3ddc129ef91db4868d7 (patch)
treeafcf31398b637526b20ac730556cbfd6c3c6b255 /src/indexamajig.c
parentf8e58b42627f7713ff6e021af24e1f2dbd9d8b0d (diff)
indexamajig: Don't load unit cell if none given
This fixes some incorrect behaviour introduced by c7712c20.
Diffstat (limited to 'src/indexamajig.c')
-rw-r--r--src/indexamajig.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/indexamajig.c b/src/indexamajig.c
index 8a123aa4..f628eb29 100644
--- a/src/indexamajig.c
+++ b/src/indexamajig.c
@@ -449,10 +449,6 @@ int main(int argc, char *argv[])
}
free(speaks);
- if ( pdb == NULL ) {
- pdb = strdup("molecule.pdb");
- }
-
if ( prefix == NULL ) {
prefix = strdup("");
} else {
@@ -550,13 +546,18 @@ int main(int argc, char *argv[])
}
free(geometry);
- cell = load_cell_from_pdb(pdb);
- if ( cell == NULL ) {
- ERROR("Couldn't read unit cell (from %s)\n", pdb);
- return 1;
+ if ( pdb != NULL ) {
+ cell = load_cell_from_pdb(pdb);
+ if ( cell == NULL ) {
+ ERROR("Couldn't read unit cell (from %s)\n", pdb);
+ return 1;
+ }
+ free(pdb);
+ cell_print(cell);
+ } else {
+ STATUS("No unit cell given.\n");
+ cell = NULL;
}
- free(pdb);
- cell_print(cell);
write_stream_header(ofh, argc, argv);