summaryrefslogtreecommitdiff
path: root/src/main/Groups.c
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-05-21 12:43:53 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2005-05-21 12:43:53 +0000
commit174d0c3daf51ff530959bfaa4ea1e9890adcad56 (patch)
tree98ae96679898bc9277a25b60a38c085251bc01b8 /src/main/Groups.c
parenta5ccbba697c7d9f5eb4d64804ba674888951af8f (diff)
Do not emit an error message "invalid group/variable name" from
CCTK_TraverseString if a name is a valid group name, but the group has zero variables. Instead, do nothing in this case, which is correct, because the callback function should be called for each variable in the group. git-svn-id: http://svn.cactuscode.org/flesh/trunk@4057 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Groups.c')
-rw-r--r--src/main/Groups.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/Groups.c b/src/main/Groups.c
index c5dca0ec..3c6f8419 100644
--- a/src/main/Groups.c
+++ b/src/main/Groups.c
@@ -2231,6 +2231,8 @@ int CCTK_TraverseString (const char *traverse_string,
if (gindex >= 0)
{
/* We have a group so now need all the variables in the group */
+ /* Note: CCTK_FirstVarIndexI is negative if there are zero
+ variables in the group */
first = CCTK_FirstVarIndexI (gindex);
last = first + CCTK_NumVarsInGroupI (gindex) - 1;
}
@@ -2261,7 +2263,10 @@ int CCTK_TraverseString (const char *traverse_string,
}
retval += last - first + 1;
}
- else
+ /* Only emit an error message if the name is really invalid. If
+ it is a valid group name, but the group has zero variables,
+ then it will be first<0 and gindex>=0. */
+ else if (gindex < 0)
{
CCTK_VWarn (1, __LINE__, __FILE__, "Cactus",
"CCTK_TraverseString: invalid group/variable name '%s' in "