From f0813917514b9a26ce84d04538164688035405ce Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 17 Jul 2011 20:30:54 +0300 Subject: Mark FPAT as non standard. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index b30924b6..120d9ff8 100644 --- a/main.c +++ b/main.c @@ -924,7 +924,7 @@ static const struct varinit varinit[] = { {&FILENAME_node, "FILENAME", "", 0, NULL, NULL, FALSE, 0 }, {&FNR_node, "FNR", NULL, 0, update_FNR, set_FNR, TRUE, 0 }, {&FS_node, "FS", " ", 0, NULL, set_FS, FALSE, 0 }, -{&FPAT_node, "FPAT", "[^[:space:]]+", 0, NULL, set_FPAT, FALSE, 0 }, +{&FPAT_node, "FPAT", "[^[:space:]]+", 0, NULL, set_FPAT, FALSE, NON_STANDARD }, {&IGNORECASE_node, "IGNORECASE", NULL, 0, NULL, set_IGNORECASE, FALSE, NON_STANDARD }, {&LINT_node, "LINT", NULL, 0, NULL, set_LINT, FALSE, NON_STANDARD }, {&NF_node, "NF", NULL, -1, update_NF, set_NF, FALSE, 0 }, -- cgit v1.2.3 From 452f4efefd5511bc7dbe95b0167b10b403cdcf45 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 26 Jul 2011 06:05:42 +0300 Subject: Fix gsub and getline pass by reference. Add tests. --- main.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'main.c') diff --git a/main.c b/main.c index 120d9ff8..657de326 100644 --- a/main.c +++ b/main.c @@ -1127,6 +1127,26 @@ is_std_var(const char *var) return FALSE; } + +/* get_spec_varname --- return the name of a special variable + with the given assign or update routine. +*/ + +const char * +get_spec_varname(Func_ptr fptr) +{ + const struct varinit *vp; + + if (! fptr) + return NULL; + for (vp = varinit; vp->name != NULL; vp++) { + if (vp->assign == fptr || vp->update == fptr) + return vp->name; + } + return NULL; +} + + /* arg_assign --- process a command-line assignment */ int -- cgit v1.2.3 From 997dbc7f520c811e4c5325b9536f72cb454560cc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 21 Sep 2011 22:45:28 +0300 Subject: Make no mbs support work everywhere. Sheesh. --- main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 657de326..66d4b9b6 100644 --- a/main.c +++ b/main.c @@ -148,7 +148,7 @@ int do_binary = FALSE; /* hands off my data! */ int do_sandbox = FALSE; /* sandbox mode - disable 'system' function & redirections */ int use_lc_numeric = FALSE; /* obey locale for decimal point */ -#ifdef MBS_SUPPORT +#if MBS_SUPPORT int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */ #else const int gawk_mb_cur_max = 1; @@ -267,7 +267,7 @@ main(int argc, char **argv) setlocale(LC_TIME, ""); #endif -#ifdef MBS_SUPPORT +#if MBS_SUPPORT /* * In glibc, MB_CUR_MAX is actually a function. This value is * tested *a lot* in many speed-critical places in gawk. Caching @@ -556,7 +556,7 @@ out: if (do_lint && os_is_setuid()) warning(_("running %s setuid root may be a security problem"), myname); -#ifdef MBS_SUPPORT +#if MBS_SUPPORT if (do_binary) { if (do_posix) warning(_("`--posix' overrides `--binary'")); -- cgit v1.2.3 From 6735db9861e32576ece279f7e9e0ecaa314786a2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Tue, 4 Oct 2011 21:57:57 +0200 Subject: Make gawk_mb_cur_max compile time constant if no mbs support. --- main.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 66d4b9b6..43a3e4a5 100644 --- a/main.c +++ b/main.c @@ -150,8 +150,6 @@ int use_lc_numeric = FALSE; /* obey locale for decimal point */ #if MBS_SUPPORT int gawk_mb_cur_max; /* MB_CUR_MAX value, see comment in main() */ -#else -const int gawk_mb_cur_max = 1; #endif FILE *output_fp; /* default output for debugger */ -- cgit v1.2.3