From 3ceb23374fc269d883dc5d56e40518db77efea1a Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 24 Jun 2014 18:10:22 +0300 Subject: Make --pretty-print not run the program. --- main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c6fef2f1..901bfea5 100644 --- a/main.c +++ b/main.c @@ -739,9 +739,8 @@ out: if (do_debug) debug_prog(code_block); - else if (do_pretty_print && ! do_debug && getenv("GAWK_NO_PP_RUN") != NULL) - /* hack to run pretty printer only. need a better solution */ - ; + else if (do_pretty_print && ! do_profile) + ; /* run pretty printer only. */ else interpret(code_block); -- cgit v1.2.3 From 412c272389116f18218148c7a84c0486ad814051 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 24 Jul 2014 15:39:31 -0400 Subject: Fix option ordering in usage output. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 47fd51c9..422f1406 100644 --- a/main.c +++ b/main.c @@ -820,9 +820,9 @@ usage(int exitval, FILE *fp) fputs(_("\t-i includefile\t\t--include=includefile\n"), fp); fputs(_("\t-l library\t\t--load=library\n"), fp); fputs(_("\t-L [fatal]\t\t--lint[=fatal]\n"), fp); - fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp); fputs(_("\t-M\t\t\t--bignum\n"), fp); fputs(_("\t-N\t\t\t--use-lc-numeric\n"), fp); + fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp); fputs(_("\t-o[file]\t\t--pretty-print[=file]\n"), fp); fputs(_("\t-O\t\t\t--optimize\n"), fp); fputs(_("\t-p[file]\t\t--profile[=file]\n"), fp); -- cgit v1.2.3 From c93614354db29e990db243a36c8030ad1c9ca1b7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 25 Jul 2014 11:52:35 -0400 Subject: Add a warning if -M used and MPFR not available. --- main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 422f1406..2691e224 100644 --- a/main.c +++ b/main.c @@ -472,6 +472,8 @@ main(int argc, char **argv) case 'M': #ifdef HAVE_MPFR do_flags |= DO_MPFR; +#else + warning(_("-M ignored: MPFR/GMP support not compiled in")); #endif break; -- cgit v1.2.3 From 825dd9a1839ca42c4ed6152de41515958e11660d Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Thu, 31 Jul 2014 19:42:41 +0300 Subject: Clean up some memory in MPFR. --- main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 2691e224..f76608c9 100644 --- a/main.c +++ b/main.c @@ -755,6 +755,11 @@ out: if (do_dump_vars) dump_vars(varfile); +#ifdef HAVE_MPFR + if (do_mpfr) + cleanup_mpfr(); +#endif + if (do_tidy_mem) release_all_vars(); -- cgit v1.2.3 From 5e5e1e890b276d93f09317883dd7ce8555c6a1a8 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 15 Aug 2014 14:00:22 +0300 Subject: Adjust -L option in usage output, update test. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index f76608c9..4ce39ba0 100644 --- a/main.c +++ b/main.c @@ -826,7 +826,7 @@ usage(int exitval, FILE *fp) fputs(_("\t-h\t\t\t--help\n"), fp); fputs(_("\t-i includefile\t\t--include=includefile\n"), fp); fputs(_("\t-l library\t\t--load=library\n"), fp); - fputs(_("\t-L [fatal]\t\t--lint[=fatal]\n"), fp); + fputs(_("\t-L[fatal|invalid]\t--lint[=fatal|invalid]\n"), fp); fputs(_("\t-M\t\t\t--bignum\n"), fp); fputs(_("\t-N\t\t\t--use-lc-numeric\n"), fp); fputs(_("\t-n\t\t\t--non-decimal-data\n"), fp); -- cgit v1.2.3 From 12e05615041147de61658bda8f5e7d5a4acd87c3 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 26 Aug 2014 21:18:03 +0300 Subject: Remove support for MirBSD. Yay! --- main.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 49cdf51f..fc87d605 100644 --- a/main.c +++ b/main.c @@ -262,17 +262,6 @@ main(int argc, char **argv) */ gawk_mb_cur_max = MB_CUR_MAX; /* Without MBS_SUPPORT, gawk_mb_cur_max is 1. */ -#ifdef LIBC_IS_BORKED -{ - const char *env_lc; - - env_lc = getenv("LC_ALL"); - if (env_lc == NULL) - env_lc = getenv("LANG"); - if (env_lc != NULL && env_lc[1] == '\0' && tolower(env_lc[0]) == 'c') - gawk_mb_cur_max = 1; -} -#endif /* init the cache for checking bytes if they're characters */ init_btowc_cache(); -- cgit v1.2.3 From 0f5cb955662136ad4a93e35db5721dd986dfd55b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 5 Sep 2014 11:21:38 +0300 Subject: Add builtin functions to FUNCTAB and PROCINFO["identifiers"] and doc. --- main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 4ce39ba0..129382c1 100644 --- a/main.c +++ b/main.c @@ -705,6 +705,8 @@ out: if (do_intl) exit(EXIT_SUCCESS); + install_builtins(); + if (do_lint) shadow_funcs(); -- cgit v1.2.3 From f9fadc3b2bf0bf9d65a981a712aa9aebc21a699b Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 7 Sep 2014 20:41:47 +0300 Subject: Minor code cleanups. --- main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 129382c1..e46b0796 100644 --- a/main.c +++ b/main.c @@ -33,6 +33,16 @@ #include #endif +#ifdef HAVE_LIBSIGSEGV +#include +#else +typedef void *stackoverflow_context_t; +/* the argument to this macro is purposely not used */ +#define sigsegv_install_handler(catchsegv) signal(SIGSEGV, catchsig) +/* define as 0 rather than empty so that (void) cast on it works */ +#define stackoverflow_install_handler(catchstackoverflow, extra_stack, STACK_SIZE) 0 +#endif + #define DEFAULT_PROFILE "awkprof.out" /* where to put profile */ #define DEFAULT_VARFILE "awkvars.out" /* where to put vars */ #define DEFAULT_PREC 53 -- cgit v1.2.3 From 3fcce8a32e825dd10384d5276c420c2514442fe2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 15 Sep 2014 19:47:03 +0300 Subject: Finish excising isalpha and isalnum. Document. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index e46b0796..645a4561 100644 --- a/main.c +++ b/main.c @@ -1337,11 +1337,11 @@ arg_assign(char *arg, bool initing) /* first check that the variable name has valid syntax */ badvar = false; - if (! isalpha((unsigned char) arg[0]) && arg[0] != '_') + if (! is_alpha((unsigned char) arg[0]) && arg[0] != '_') badvar = true; else for (cp2 = arg+1; *cp2; cp2++) - if (! isalnum((unsigned char) *cp2) && *cp2 != '_') { + if (! is_identchar((unsigned char) *cp2)) { badvar = true; break; } -- cgit v1.2.3