From 6c09c80378028858d439158d923f94a72d30efc6 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 12 Jan 2014 20:22:55 +0200 Subject: Minor improvements in a few files. --- ext.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'ext.c') diff --git a/ext.c b/ext.c index 60765e07..cae882ff 100644 --- a/ext.c +++ b/ext.c @@ -7,7 +7,7 @@ */ /* - * Copyright (C) 1995 - 2001, 2003-2013 the Free Software Foundation, Inc. + * Copyright (C) 1995 - 2001, 2003-2014 the Free Software Foundation, Inc. * * This file is part of GAWK, the GNU implementation of the * AWK Programming Language. @@ -223,9 +223,7 @@ make_builtin(const awk_ext_func_t *funcinfo) if (! is_letter(*sp)) return false; - sp++; - - while ((c = *sp++) != '\0') { + for (sp++; (c = *sp++) != '\0';) { if (! is_identifier_char(c)) return false; } @@ -277,9 +275,11 @@ make_old_builtin(const char *name, NODE *(*func)(int), int count) /* temporary * if (sp == NULL || *sp == '\0') fatal(_("extension: missing function name")); - while ((c = *sp++) != '\0') { - if ((sp == & name[1] && c != '_' && ! isalpha((unsigned char) c)) - || (sp > &name[1] && ! is_identifier_char((unsigned char) c))) + if (! is_letter(*sp)) + fatal(_("extension: illegal character `%c' in function name `%s'"), *sp, name); + + for (sp++; (c = *sp++) != '\0';) { + if (! is_identifier_char(c)) fatal(_("extension: illegal character `%c' in function name `%s'"), c, name); } @@ -312,6 +312,7 @@ make_old_builtin(const char *name, NODE *(*func)(int), int count) /* temporary * symbol = install_symbol(estrdup(name, strlen(name)), Node_old_ext_func); symbol->code_ptr = b; + track_ext_func(name); } -- cgit v1.2.3