aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2020-09-04 15:53:43 +0200
committerThomas White <taw@physics.org>2020-09-04 15:53:43 +0200
commit9fd148bcb8047a8fe43ad776f9555aaac152c887 (patch)
treea5ebecf5691308c9a12003d21d32dad0cfced74c
parenta1a4d92fd5814bd1b7f8fb1426e191e6ad5be54e (diff)
Omit some more arguments if NULL
-rw-r--r--src/gui_index.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui_index.c b/src/gui_index.c
index 60f93c61..bd4cd652 100644
--- a/src/gui_index.c
+++ b/src/gui_index.c
@@ -647,8 +647,10 @@ char **indexamajig_command_line(const char *geom_filename,
add_arg(args, n_args++, indexamajig_path);
add_arg(args, n_args++, "-i");
add_arg(args, n_args++, files_list);
- add_arg(args, n_args++, "-g");
- add_arg(args, n_args++, geom_filename);
+ if ( geom_filename != NULL ) {
+ add_arg(args, n_args++, "-g");
+ add_arg(args, n_args++, geom_filename);
+ }
add_arg(args, n_args++, "-o");
add_arg(args, n_args++, stream_filename);
add_arg(args, n_args++, "-j");
@@ -689,8 +691,10 @@ char **indexamajig_command_line(const char *geom_filename,
}
/* Indexing */
- add_arg(args, n_args++, "--indexing");
- add_arg(args, n_args++, indexing_params->indexing_methods);
+ if ( indexing_params->indexing_methods != NULL ) {
+ add_arg(args, n_args++, "--indexing");
+ add_arg(args, n_args++, indexing_params->indexing_methods);
+ }
if ( indexing_params->cell_file != NULL ) {
add_arg(args, n_args++, "-p");
add_arg(args, n_args++, indexing_params->cell_file);