/****************************************************************************
- * Copyright 2020 Thomas E. Dickey *
+ * Copyright 2020,2021 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
#include "form.priv.h"
-MODULE_ID("$Id: fty_enum.c,v 1.31 2020/12/12 01:15:37 tom Exp $")
+MODULE_ID("$Id: fty_enum.c,v 1.32 2021/03/27 23:49:53 tom Exp $")
typedef struct
{
int cnt = 0;
char **kp = (char **)0;
char **kwds = (char **)0;
- char **kptarget;
int ccase, cunique;
T((T_CREATE("enumARG %p"), (void *)argp));
if (cnt > 0)
{
+ char **kptarget;
+
/* We copy the keywords, because we can't rely on the fact
that the caller doesn't relocate or free the memory used
for the keywords (maybe he has GC)
bool unique = ((const enumARG *)argp)->checkunique;
unsigned char *bp = (unsigned char *)field_buffer(field, 0);
char *s, *t, *p;
- int res;
while (kwds && (s = (*kwds++)))
{
+ int res;
+
if ((res = Compare((unsigned char *)s, bp, ccase)) != NOMATCH)
{
p = t = s; /* t is at least a partial match */