Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle single array item #34

Merged
merged 2 commits into from
Aug 25, 2018
Merged

Handle single array item #34

merged 2 commits into from
Aug 25, 2018

Conversation

PaulWessel
Copy link
Member

In order to give an array list via -T with a single value we must end with a comma, otherwise it is seen as a fixed increment instead. For instance, -T5 means use array increment of 5 while -T5, means "create an array with one element which is 5". The -T option is used in many modules, such as sample1d.

In order to give an array list with a single value we must end with a comma, otherwise it is seen as a fixed increment.
@PaulWessel PaulWessel requested a review from a team August 24, 2018 20:09
@@ -15615,7 +15615,7 @@ unsigned int gmt_create_array (struct GMT_CTRL *GMT, char option, struct GMT_ARR
uint64_t k;
unsigned int pos = 0;
char p[GMT_LEN64] = {""};
for (k = 0, T->n = 1; k < strlen (T->list); k++) if (T->list[k] == ',') T->n++; /* Count the commas */
for (k = 0, T->n = 1; k < strlen (T->list); k++) if (T->list[k] == ',' && T->list[k+1]) T->n++; /* Count the commas */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please break this for() ... if () ... line. Those are awful cases to debug

Breaking up some lines
Copy link
Member

@joa-quim joa-quim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicer

@joa-quim joa-quim merged commit 5f12027 into master Aug 25, 2018
@joa-quim joa-quim deleted the arraylist branch August 25, 2018 01:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants