aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/ecpg/preproc/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/interfaces/ecpg/preproc/variable.c')
-rw-r--r--src/interfaces/ecpg/preproc/variable.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/interfaces/ecpg/preproc/variable.c b/src/interfaces/ecpg/preproc/variable.c
index 887d479e735..2a2b9531187 100644
--- a/src/interfaces/ecpg/preproc/variable.c
+++ b/src/interfaces/ecpg/preproc/variable.c
@@ -497,15 +497,20 @@ check_indicator(struct ECPGtype *var)
}
struct typedefs *
-get_typedef(char *name)
+get_typedef(const char *name, bool noerror)
{
struct typedefs *this;
- for (this = types; this && strcmp(this->name, name) != 0; this = this->next);
- if (!this)
+ for (this = types; this != NULL; this = this->next)
+ {
+ if (strcmp(this->name, name) == 0)
+ return this;
+ }
+
+ if (!noerror)
mmfatal(PARSE_ERROR, "unrecognized data type name \"%s\"", name);
- return this;
+ return NULL;
}
void