From 2fb91e19a02ff8a3e43145d582cfebaf3a60f1d9 Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Sat, 5 Oct 2013 16:10:30 -0400 Subject: Sanitize the registered function interface. Expand the characters which are legal in a function name, and check the name for validity. Create a type for the function pointer. Convert the last argument from a boolean to flags, to allow for expansion. --- main.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 7069669..f60e6be 100644 --- a/main.c +++ b/main.c @@ -612,10 +612,13 @@ initialize_stopchar_map () stopchar_map[(int)':'] = MAP_COLON; stopchar_map[(int)'%'] = MAP_PERCENT; stopchar_map[(int)'|'] = MAP_PIPE; - stopchar_map[(int)'.'] = MAP_DOT; + stopchar_map[(int)'.'] = MAP_DOT | MAP_USERFUNC; stopchar_map[(int)','] = MAP_COMMA; stopchar_map[(int)'$'] = MAP_VARIABLE; + stopchar_map[(int)'-'] = MAP_USERFUNC; + stopchar_map[(int)'_'] = MAP_USERFUNC; + stopchar_map[(int)'/'] = MAP_PATHSEP; #if defined(VMS) stopchar_map[(int)']'] = MAP_PATHSEP; @@ -629,6 +632,8 @@ initialize_stopchar_map () stopchar_map[i] = MAP_BLANK; if (isspace(i)) stopchar_map[i] |= MAP_SPACE; + if (isalnum(i)) + stopchar_map[i] = MAP_USERFUNC; } } -- cgit v1.2.3