diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-12 20:42:08 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-01-12 20:42:08 +0200 |
commit | 624d70844fe63068132adb7c66ea3f8a231e56a7 (patch) | |
tree | 79781e2b0e24b5e478804001c83fcde64602f502 /ext.c | |
parent | da83b6857bf0a67b15fc75d31a0b6802ac9baffe (diff) | |
parent | f934f2192779db0091d1706d97d1fd43cb26dc9a (diff) | |
download | egawk-624d70844fe63068132adb7c66ea3f8a231e56a7.tar.gz egawk-624d70844fe63068132adb7c66ea3f8a231e56a7.tar.bz2 egawk-624d70844fe63068132adb7c66ea3f8a231e56a7.zip |
Merge branch 'master' into comment
Diffstat (limited to 'ext.c')
-rw-r--r-- | ext.c | 19 |
1 files changed, 10 insertions, 9 deletions
@@ -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. @@ -174,9 +174,9 @@ load_old_ext(SRCFILE *s, const char *init_func, const char *fini_func, NODE *obj fatal(_("`extension' is a gawk extension")); if (lib_name == NULL) - fatal(_("load_ext: received NULL lib_name")); + fatal(_("extension: received NULL lib_name")); - if ((dl = dlopen(s->fullpath, flags)) == NULL) + if ((dl = dlopen(lib_name, flags)) == NULL) fatal(_("extension: cannot open library `%s' (%s)"), lib_name, dlerror()); @@ -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); } |