From 29b5a3c1aaad92e7a87c85f88d6adebd33acea04 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 28 Nov 2019 12:19:51 -0300 Subject: [PATCH] Using only alfanumeric chars to translate toggle names. --- src/core/toggles/table.c | 17 ++++++++++++++++- src/include/lib3270/toggle.h | 6 ++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/core/toggles/table.c b/src/core/toggles/table.c index 51caaf2..315979b 100644 --- a/src/core/toggles/table.c +++ b/src/core/toggles/table.c @@ -37,6 +37,7 @@ #include #include #include "togglesc.h" +#include "utilc.h" /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ @@ -367,6 +368,20 @@ LIB3270_EXPORT const char * lib3270_get_toggle_name(LIB3270_TOGGLE_ID ix) return ""; } +LIB3270_EXPORT const LIB3270_TOGGLE * lib3270_toggle_get_by_name(const char *name) +{ + if(name) + { + int ix; + for(ix=0;ix