summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-10-23 12:16:49 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-10-23 12:16:49 +0300
commitb4f33f6a4588ad62b4cffa05f81ba31ed224bd0d (patch)
tree16c527d00279e49c719ca6eccea2332588d12969
parent56825d3fa941b89506d903a965f0296c2b94c161 (diff)
parent3055361c2a022c9ac9ae42ac88c00e3055498a0d (diff)
downloadgawk-b4f33f6a4588ad62b4cffa05f81ba31ed224bd0d.tar.gz
Merge branch 'master' into feature/typed-regex
-rw-r--r--ChangeLog6
-rw-r--r--array.c46
-rw-r--r--awk.h42
-rw-r--r--awkgram.c154
-rw-r--r--awkgram.y168
-rw-r--r--awklib/eg/lib/grcat.c1
-rw-r--r--builtin.c106
-rw-r--r--cint_array.c50
-rw-r--r--cmd.h14
-rw-r--r--command.c58
-rw-r--r--command.y80
-rw-r--r--custom.h10
-rw-r--r--debug.c270
-rw-r--r--doc/ChangeLog5
-rw-r--r--doc/gawk.info1405
-rw-r--r--doc/gawk.texi283
-rw-r--r--doc/gawktexi.in283
-rw-r--r--eval.c46
-rw-r--r--ext.c24
-rw-r--r--extension/ChangeLog4
-rw-r--r--extension/filefuncs.c12
-rw-r--r--extension/fnmatch.c8
-rw-r--r--extension/fork.c8
-rw-r--r--extension/inplace.c10
-rw-r--r--extension/ordchr.c8
-rw-r--r--extension/readdir.c8
-rw-r--r--extension/readfile.c8
-rw-r--r--extension/revoutput.c8
-rw-r--r--extension/revtwoway.c8
-rw-r--r--extension/rwarray.c12
-rw-r--r--extension/rwarray0.c12
-rw-r--r--extension/stack.c10
-rw-r--r--extension/testext.c16
-rw-r--r--field.c50
-rw-r--r--floatcomp.c10
-rw-r--r--floatmagic.h12
-rw-r--r--gawkapi.c16
-rw-r--r--gawkapi.h20
-rw-r--r--gawkmisc.c10
-rw-r--r--helpers/ChangeLog4
-rw-r--r--helpers/testdfa.c22
-rw-r--r--helpers/testnet.c8
-rw-r--r--int_array.c38
-rw-r--r--interpret.h62
-rw-r--r--io.c100
-rw-r--r--main.c34
-rw-r--r--mbsupport.h10
-rw-r--r--missing_d/ChangeLog4
-rw-r--r--missing_d/snprintf.c10
-rw-r--r--mpfr.c60
-rw-r--r--msg.c10
-rw-r--r--node.c26
-rw-r--r--nonposix.h10
-rw-r--r--old-extension/ChangeLog4
-rw-r--r--old-extension/bindarr.c12
-rw-r--r--old-extension/fileop.c10
-rw-r--r--old-extension/sparr.c14
-rw-r--r--old-extension/spec_array.c22
-rw-r--r--pc/ChangeLog4
-rw-r--r--pc/popen.c2
-rw-r--r--posix/ChangeLog4
-rw-r--r--posix/gawkmisc.c6
-rw-r--r--profile.c52
-rw-r--r--protos.h14
-rw-r--r--random.h10
-rw-r--r--re.c16
-rw-r--r--regcomp.c2
-rw-r--r--replace.c12
-rw-r--r--str_array.c34
-rw-r--r--symbol.c38
-rw-r--r--vms/ChangeLog4
-rw-r--r--vms/vms_gawk.c2
72 files changed, 1703 insertions, 2258 deletions
diff --git a/ChangeLog b/ChangeLog
index eb1947fc..cb636b7e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+ * mpfr.c: Replace Unicode sequences with ASCII.
+ * cint_array.c: Ditto.
+
2016-10-16 Arnold D. Robbins <arnold@skeeve.com>
* awkgram.y: Typo fix in call to add_sign_to_num.
diff --git a/array.c b/array.c
index d9c80a35..85377081 100644
--- a/array.c
+++ b/array.c
@@ -2,23 +2,23 @@
* array.c - routines for awk arrays.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2014, 2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -102,7 +102,7 @@ make_array()
/* vname, flags, and parent_array not set here */
return array;
-}
+}
/* null_array --- force symbol to be an empty typeless array */
@@ -150,7 +150,7 @@ null_lookup(NODE *symbol, NODE *subs)
return symbol->alookup(symbol, subs);
}
-/* null_length --- default function for array length interface */
+/* null_length --- default function for array length interface */
NODE **
null_length(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
@@ -198,7 +198,7 @@ assoc_copy(NODE *symbol, NODE *newsymb)
void
assoc_dump(NODE *symbol, NODE *ndump)
{
- if (symbol->adump)
+ if (symbol->adump)
(void) symbol->adump(symbol, ndump);
}
@@ -229,7 +229,7 @@ make_aname(const NODE *symbol)
max_alen = alen + SLEN;
emalloc(aname, char *, (max_alen + 1) * sizeof(char *), "make_aname");
} else if (alen > max_alen) {
- max_alen = alen + SLEN;
+ max_alen = alen + SLEN;
erealloc(aname, char *, (max_alen + 1) * sizeof(char *), "make_aname");
}
memcpy(aname, symbol->vname, alen + 1);
@@ -258,11 +258,11 @@ array_vname(const NODE *symbol)
const NODE *save_symbol = symbol;
const char *from = _("from %s");
const char *aname;
-
+
if (symbol->type != Node_array_ref
|| symbol->orig_array->type != Node_var_array
) {
- if (symbol->type != Node_var_array || symbol->parent_array == NULL)
+ if (symbol->type != Node_var_array || symbol->parent_array == NULL)
return symbol->vname;
return make_aname(symbol);
}
@@ -373,7 +373,7 @@ force_array(NODE *symbol, bool canfatal)
/* set_SUBSEP --- update SUBSEP related variables when SUBSEP assigned to */
-
+
void
set_SUBSEP()
{
@@ -396,7 +396,7 @@ concat_exp(int nargs, bool do_subsep)
size_t subseplen = 0;
int i;
extern NODE **args_array;
-
+
if (nargs == 1)
return POP_STRING();
@@ -498,13 +498,13 @@ adjust_fcall_stack(NODE *symbol, int nsubs)
* But excludes cases like (nsubs = 0):
*
* function f(c, d) { delete c; ..}
- * BEGIN { a[0][0] = 1; f(a[0], a[0]); ...}
+ * BEGIN { a[0][0] = 1; f(a[0], a[0]); ...}
*/
null_array(r);
r->parent_array = NULL;
continue;
- }
+ }
/* Case 2 */
for (n = n->parent_array; n != NULL; n = n->parent_array) {
@@ -648,7 +648,7 @@ do_delete_loop(NODE *symbol, NODE **lhs)
efree(list);
/* blast the array in one shot */
- adjust_fcall_stack(symbol, 0);
+ adjust_fcall_stack(symbol, 0);
assoc_clear(symbol);
}
@@ -703,7 +703,7 @@ value_info(NODE *n)
if ((n->flags & (STRING|STRCUR)) == STRCUR) {
fprintf(output_fp, "][");
- fprintf(output_fp, "stfmt=%d, ", n->stfmt);
+ fprintf(output_fp, "stfmt=%d, ", n->stfmt);
/*
* If not STFMT_UNUSED, could be CONVFMT or OFMT if last
* used in a print statement. If immutable, could be that it
@@ -1054,7 +1054,7 @@ sort_up_index_number(const void *p1, const void *p2)
ret = cmp_numbers(t1, t2);
if (ret != 0)
- return ret;
+ return ret;
/* break a tie with the index string itself */
t1 = force_string((NODE *) t1);
@@ -1241,7 +1241,7 @@ sort_user_func(const void *p1, const void *p2)
}
-/* assoc_list -- construct, and optionally sort, a list of array elements */
+/* assoc_list -- construct, and optionally sort, a list of array elements */
NODE **
assoc_list(NODE *symbol, const char *sort_str, sort_context_t sort_ctxt)
@@ -1280,7 +1280,7 @@ assoc_list(NODE *symbol, const char *sort_str, sort_context_t sort_ctxt)
extern int currule;
int save_rule = 0;
assoc_kind_t assoc_kind = ANONE;
-
+
elem_size = 1;
for (qi = 0, j = sizeof(sort_funcs)/sizeof(sort_funcs[0]); qi < j; qi++) {
@@ -1304,7 +1304,7 @@ assoc_list(NODE *symbol, const char *sort_str, sort_context_t sort_ctxt)
} else { /* unrecognized */
NODE *f;
- const char *sp;
+ const char *sp;
for (sp = sort_str; *sp != '\0' && ! isspace((unsigned char) *sp); sp++)
continue;
@@ -1328,7 +1328,7 @@ assoc_list(NODE *symbol, const char *sort_str, sort_context_t sort_ctxt)
code->func_body = f;
code->func_name = NULL; /* not needed, func_body already assigned */
(code + 1)->expr_count = 4; /* function takes 4 arguments */
- code->nexti = bcalloc(Op_stop, 1, 0);
+ code->nexti = bcalloc(Op_stop, 1, 0);
/*
* make non-redirected getline, exit, `next' and `nextfile' fatal in
@@ -1355,7 +1355,7 @@ assoc_list(NODE *symbol, const char *sort_str, sort_context_t sort_ctxt)
if (cmp_func == sort_user_func) {
code = POP_CODE();
- currule = save_rule; /* restore current rule */
+ currule = save_rule; /* restore current rule */
bcfree(code->nexti); /* Op_stop */
bcfree(code); /* Op_func_call */
}
diff --git a/awk.h b/awk.h
index e0f59b13..df901190 100644
--- a/awk.h
+++ b/awk.h
@@ -1,23 +1,23 @@
/*
- * awk.h -- Definitions for gawk.
+ * awk.h -- Definitions for gawk.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -547,7 +547,7 @@ typedef struct exp_node {
#define array_size sub.nodep.cnt
#define array_capacity sub.nodep.reserved
#define xarray sub.nodep.rn
-#define parent_array sub.nodep.x.extra
+#define parent_array sub.nodep.x.extra
#define ainit array_funcs[0]
#define ainit_ind 0
@@ -664,7 +664,7 @@ typedef enum opcodeval {
Op_nomatch,
Op_rule,
-
+
/* keywords */
Op_K_case,
Op_K_default,
@@ -729,13 +729,13 @@ typedef enum opcodeval {
Op_stop,
/* parsing (yylex and yyparse), should never appear in valid compiled code */
- Op_token,
+ Op_token,
Op_symbol,
Op_list,
/* program structures -- for use in the profiler/pretty printer */
Op_K_do,
- Op_K_for,
+ Op_K_for,
Op_K_arrayfor,
Op_K_while,
Op_K_switch,
@@ -804,7 +804,7 @@ typedef struct exp_instruction {
/* Op_K_exit */
#define target_end d.di
-#define target_atexit x.xi
+#define target_atexit x.xi
/* Op_newfile, Op_K_getline, Op_nextfile */
#define target_endfile x.xi
@@ -893,7 +893,7 @@ typedef struct exp_instruction {
#define field_assign x.aptr
/* Op_field_assign, Op_var_assign */
-#define assign_ctxt d.dl
+#define assign_ctxt d.dl
/* Op_concat */
#define concat_flag d.dl
@@ -926,7 +926,7 @@ typedef struct exp_instruction {
/* Op_line_range */
#define condpair_left d.di
-#define condpair_right x.xi
+#define condpair_right x.xi
/* Op_store_var */
#define initval x.xn
@@ -1016,7 +1016,7 @@ typedef struct srcfile {
int fd;
int maxlen; /* size of the longest line */
- void (*fini_func)(); /* dynamic extension of type SRC_EXTLIB */
+ void (*fini_func)(); /* dynamic extension of type SRC_EXTLIB */
char *lexptr;
char *lexend;
@@ -1054,7 +1054,7 @@ enum block_id {
BLOCK_NODE,
BLOCK_BUCKET,
BLOCK_MAX /* count */
-};
+};
typedef int (*Func_pre_exec)(INSTRUCTION **);
typedef void (*Func_post_exec)(INSTRUCTION *);
@@ -1068,7 +1068,7 @@ typedef void (*Func_post_exec)(INSTRUCTION *);
#ifndef LONG_MIN
#define LONG_MIN ((long)(-LONG_MAX - 1L))
#endif
-#define UNLIMITED LONG_MAX
+#define UNLIMITED LONG_MAX
/* -------------------------- External variables -------------------------- */
/* gawk builtin variables */
@@ -1213,7 +1213,7 @@ extern STACK_ITEM *stack_top;
#define POP_ADDRESS() (decr_sp()->lptr)
#define PEEK(n) ((stack_ptr - (n))->rptr)
#define TOP() (stack_ptr->rptr) /* same as PEEK(0) */
-#define TOP_ADDRESS() (stack_ptr->lptr)
+#define TOP_ADDRESS() (stack_ptr->lptr)
#define PUSH(r) (void) (incr_sp()->rptr = (r))
#define PUSH_ADDRESS(l) (void) (incr_sp()->lptr = (l))
#define REPLACE(r) (void) (stack_ptr->rptr = (r))
@@ -1339,7 +1339,7 @@ if (--val) \
typedef enum { SORTED_IN = 1, ASORT, ASORTI } sort_context_t;
typedef enum {
ANONE = 0x00, /* "unused" value */
- AINDEX = 0x001, /* list of indices */
+ AINDEX = 0x001, /* list of indices */
AVALUE = 0x002, /* list of values */
AINUM = 0x004, /* numeric index */
AISTR = 0x008, /* string index */
@@ -1762,7 +1762,7 @@ POP_SCALAR()
if (t->type == Node_var_array)
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(t));
-
+
return t;
}
@@ -1775,7 +1775,7 @@ TOP_SCALAR()
if (t->type == Node_var_array)
fatal(_("attempt to use array `%s' in a scalar context"), array_vname(t));
-
+
return t;
}
@@ -1793,7 +1793,7 @@ in_array(NODE *a, NODE *s)
NODE **ret;
ret = a->aexists(a, s);
-
+
return ret ? *ret : NULL;
}
diff --git a/awkgram.c b/awkgram.c
index a95cd11f..bcae30bc 100644
--- a/awkgram.c
+++ b/awkgram.c
@@ -80,7 +80,7 @@ static void lintwarn_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
static void warning_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
static char *get_src_buf(void);
static int yylex(void);
-int yyparse(void);
+int yyparse(void);
static INSTRUCTION *snode(INSTRUCTION *subn, INSTRUCTION *op);
static char **check_params(char *fname, int pcount, INSTRUCTION *list);
static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
@@ -155,7 +155,7 @@ static char *lexptr; /* pointer to next char during parsing */
static char *lexend; /* end of buffer */
static char *lexptr_begin; /* keep track of where we were for error msgs */
static char *lexeme; /* beginning of lexeme for debugging */
-static bool lexeof; /* seen EOF for current source? */
+static bool lexeof; /* seen EOF for current source? */
static char *thisline = NULL;
static int in_braces = 0; /* count braces for firstline, lastline in an 'action' */
static int lastline = 0;
@@ -2406,7 +2406,7 @@ yyreduce:
int case_count = 0;
int i;
- tbreak = instruction(Op_no_op);
+ tbreak = instruction(Op_no_op);
cstmt = list_create(tbreak);
cexp = list_create(instruction(Op_pop));
dflt = instruction(Op_jmp);
@@ -2433,7 +2433,7 @@ yyreduce:
error_ln(curr->source_line,
_("duplicate case values in switch body: %s"), caseval);
}
-
+
if (case_values == NULL)
emalloc(case_values, const char **, sizeof(char *) * maxcount, "statement");
else if (case_count >= maxcount) {
@@ -2484,7 +2484,7 @@ yyreduce:
(void) list_merge(ip, cexp);
(yyval) = list_merge(ip, cstmt);
- break_allowed--;
+ break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
#line 2491 "awkgram.c" /* yacc.c:1646 */
@@ -2492,14 +2492,14 @@ yyreduce:
case 48:
#line 715 "awkgram.y" /* yacc.c:1646 */
- {
+ {
/*
* -----------------
* tc:
* cond
* -----------------
* [Op_jmp_false tb ]
- * -----------------
+ * -----------------
* body
* -----------------
* [Op_jmp tc ]
@@ -2544,7 +2544,7 @@ yyreduce:
* z:
* body
* -----------------
- * tc:
+ * tc:
* cond
* -----------------
* [Op_jmp_true | z ]
@@ -2595,7 +2595,7 @@ yyreduce:
&& ((yyvsp[0])->nexti->memory->type != Node_var || !((yyvsp[0])->nexti->memory->var_update))
&& strcmp((yyvsp[0])->nexti->memory->vname, var_name) == 0
) {
-
+
/* Efficiency hack. Recognize the special case of
*
* for (iggy in foo)
@@ -2607,10 +2607,10 @@ yyreduce:
*
* Check that the body is a `delete a[i]' statement,
* and that both the loop var and array names match.
- */
+ */
NODE *arr = NULL;
- ip = (yyvsp[0])->nexti->nexti;
+ ip = (yyvsp[0])->nexti->nexti;
if ((yyvsp[-3])->nexti->opcode == Op_push && (yyvsp[-3])->lasti == (yyvsp[-3])->nexti)
arr = (yyvsp[-3])->nexti->memory;
if (arr != NULL
@@ -2636,7 +2636,7 @@ yyreduce:
/* [ Op_push_array a ]
* [ Op_arrayfor_init | ib ]
- * ic:[ Op_arrayfor_incr | ib ]
+ * ic:[ Op_arrayfor_incr | ib ]
* [ Op_var_assign if any ]
*
* body
@@ -2665,7 +2665,7 @@ regular_loop:
} /* else
$1 is NULL */
- /* add update_FOO instruction if necessary */
+ /* add update_FOO instruction if necessary */
if ((yyvsp[-4])->array_var->type == Node_var && (yyvsp[-4])->array_var->var_update) {
(void) list_append(ip, instruction(Op_var_update));
ip->lasti->update_var = (yyvsp[-4])->array_var->var_update;
@@ -2681,7 +2681,7 @@ regular_loop:
if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
((yyvsp[-7]) + 1)->forloop_cond = (yyvsp[-4]);
- ((yyvsp[-7]) + 1)->forloop_body = ip->lasti;
+ ((yyvsp[-7]) + 1)->forloop_body = ip->lasti;
}
if ((yyvsp[0]) != NULL)
@@ -2691,7 +2691,7 @@ regular_loop:
ip->lasti->target_jmp = (yyvsp[-4]);
(yyval) = list_append(ip, tbreak);
fix_break_continue(ip, tbreak, tcont);
- }
+ }
break_allowed--;
continue_allowed--;
@@ -2735,7 +2735,7 @@ regular_loop:
case 54:
#line 937 "awkgram.y" /* yacc.c:1646 */
- {
+ {
if (! break_allowed)
error_ln((yyvsp[-1])->source_line,
_("`break' is not allowed outside a loop or switch"));
@@ -2795,7 +2795,7 @@ regular_loop:
#line 979 "awkgram.y" /* yacc.c:1646 */
{
/* Initialize the two possible jump targets, the actual target
- * is resolved at run-time.
+ * is resolved at run-time.
*/
(yyvsp[-2])->target_end = ip_end; /* first instruction in end_block */
(yyvsp[-2])->target_atexit = ip_atexit; /* cleanup and go home */
@@ -2921,7 +2921,7 @@ regular_loop:
* [$1 | NULL | redir_type | expr_count]
*
*/
-regular_print:
+regular_print:
if ((yyvsp[0]) == NULL) { /* no redirection */
if ((yyvsp[-1]) == NULL) { /* printf without arg */
(yyvsp[-3])->expr_count = 0;
@@ -3078,7 +3078,7 @@ regular_print:
{
INSTRUCTION *casestmt = (yyvsp[0]);
if ((yyvsp[0]) == NULL)
- casestmt = list_create(instruction(Op_no_op));
+ casestmt = list_create(instruction(Op_no_op));
if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
(yyvsp[-4])->case_exp = (yyvsp[-3]);
@@ -3112,7 +3112,7 @@ regular_print:
case 76:
#line 1253 "awkgram.y" /* yacc.c:1646 */
- {
+ {
NODE *n = (yyvsp[0])->memory;
(void) force_number(n);
negate_num(n);
@@ -3562,7 +3562,7 @@ regular_print:
case 135:
#line 1546 "awkgram.y" /* yacc.c:1646 */
- {
+ {
(yyvsp[0])->opcode = Op_assign_quotient;
(yyval) = (yyvsp[0]);
}
@@ -3932,7 +3932,7 @@ regular_print:
) {
NODE *n = (yyvsp[0])->lasti->memory;
(void) force_number(n);
- negate_num(n);
+ negate_num(n);
(yyval) = (yyvsp[0]);
bcfree((yyvsp[-1]));
} else {
@@ -3990,7 +3990,7 @@ regular_print:
warned = true;
lintwarn("%s", msg);
}
-
+
f = (yyvsp[0])->lasti;
f->opcode = Op_indirect_func_call;
name = estrdup(f->func_name, strlen(f->func_name));
@@ -4034,7 +4034,7 @@ regular_print:
(yyval) = list_create((yyvsp[-3]));
} else {
INSTRUCTION *t = (yyvsp[-1]);
- ((yyvsp[-3]) + 1)->expr_count = count_expressions(&t, true);
+ ((yyvsp[-3]) + 1)->expr_count = count_expressions(&t, true);
(yyval) = list_append(t, (yyvsp[-3]));
}
}
@@ -4082,7 +4082,7 @@ regular_print:
case 184:
#line 1924 "awkgram.y" /* yacc.c:1646 */
{
- INSTRUCTION *ip = (yyvsp[0])->lasti;
+ INSTRUCTION *ip = (yyvsp[0])->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
if (count > 1) {
/* change Op_subscript or Op_sub_array to Op_concat */
@@ -4107,7 +4107,7 @@ regular_print:
/* install Null string as subscript. */
t = list_create(instruction(Op_push_i));
t->nexti->memory = dupnode(Nnull_string);
- (yyvsp[0])->sub_count = 1;
+ (yyvsp[0])->sub_count = 1;
} else
(yyvsp[0])->sub_count = count_expressions(&t, false);
(yyval) = list_append(t, (yyvsp[0]));
@@ -4482,7 +4482,7 @@ struct token {
# define BREAK 0x0800 /* break allowed inside */
# define CONTINUE 0x1000 /* continue allowed inside */
# define DEBUG_USE 0x2000 /* for use by developers */
-
+
NODE *(*ptr)(int); /* function that implements this keyword */
NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
};
@@ -4614,7 +4614,7 @@ getfname(NODE *(*fptr)(int))
j = sizeof(tokentab) / sizeof(tokentab[0]);
/* linear search, no other way to do it */
- for (i = 0; i < j; i++)
+ for (i = 0; i < j; i++)
if (tokentab[i].ptr == fptr || tokentab[i].ptr2 == fptr)
return tokentab[i].operator;
@@ -4687,7 +4687,7 @@ print_included_from()
int saveline, line;
SRCFILE *s;
- /* suppress current file name, line # from `.. included from ..' msgs */
+ /* suppress current file name, line # from `.. included from ..' msgs */
saveline = sourceline;
sourceline = 0;
@@ -4888,7 +4888,7 @@ mk_program()
if (prog_block == NULL) {
if (end_block->nexti == end_block->lasti
- && beginfile_block->nexti == beginfile_block->lasti
+ && beginfile_block->nexti == beginfile_block->lasti
&& endfile_block->nexti == endfile_block->lasti
) {
/* no pattern-action and (real) end, beginfile or endfile blocks */
@@ -4905,7 +4905,7 @@ mk_program()
cp = list_merge(begin_block, end_block);
if (program_comment != NULL) {
(void) list_prepend(cp, program_comment);
- }
+ }
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);
@@ -4930,7 +4930,7 @@ mk_program()
(void) list_prepend(prog_block, ip_rec);
(void) list_append(prog_block, instruction(Op_jmp));
prog_block->lasti->target_jmp = ip_rec;
-
+
list_append(beginfile_block, instruction(Op_after_beginfile));
cp = list_merge(beginfile_block, prog_block);
@@ -4942,10 +4942,10 @@ mk_program()
if (program_comment != NULL) {
(void) list_prepend(cp, program_comment);
- }
+ }
if (comment != NULL) {
(void) list_append(cp, comment);
- }
+ }
(void) list_append(cp, ip_atexit);
(void) list_append(cp, instruction(Op_stop));
@@ -4963,7 +4963,7 @@ out:
#undef end_block
#undef prog_block
#undef beginfile_block
-#undef endfile_block
+#undef endfile_block
}
/* parse_program --- read in the program and convert into a list of instructions */
@@ -5114,7 +5114,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE *thisfile, bool *already_incl
*already_included = true;
return NULL;
} else {
- /* duplicates are allowed for -f */
+ /* duplicates are allowed for -f */
if (s->stype == SRC_INC)
fatal(_("can't include `%s' and use it as a program file"), src);
/* no need to scan for further matches, since
@@ -5165,11 +5165,11 @@ include_source(INSTRUCTION *file)
sourcefile->srclines = sourceline;
sourcefile->lexptr = lexptr;
sourcefile->lexend = lexend;
- sourcefile->lexptr_begin = lexptr_begin;
+ sourcefile->lexptr_begin = lexptr_begin;
sourcefile->lexeme = lexeme;
sourcefile->lasttok = lasttok;
- /* included file becomes the current source */
+ /* included file becomes the current source */
sourcefile = s;
lexptr = NULL;
sourceline = 0;
@@ -5476,7 +5476,7 @@ tokexpand()
{
static int toksize;
int tokoffset;
-
+
if (tokstart != NULL) {
tokoffset = tok - tokstart;
toksize *= 2;
@@ -5544,7 +5544,7 @@ again:
int idx, work_ring_idx = cur_ring_idx;
mbstate_t tmp_state;
size_t mbclen;
-
+
for (idx = 0; lexptr + idx < lexend; idx++) {
tmp_state = cur_mbstate;
mbclen = mbrlen(lexptr, idx + 1, &tmp_state);
@@ -5610,7 +5610,7 @@ check_comment(void)
if (comment != NULL) {
if (first_rule) {
program_comment = comment;
- } else
+ } else
block_comment = comment;
comment = NULL;
}
@@ -5812,7 +5812,7 @@ yylex(void)
lasttok = 0;
return SUBSCRIPT;
}
-
+
if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */
return 0;
@@ -5847,7 +5847,7 @@ collect_regexp:
*
* [..[..] []] [^]] [.../...]
* [...\[...] [...\]...] [...\/...]
- *
+ *
* (Remember that all of the above are inside /.../)
*
* The code for \ handles \[, \] and \/.
@@ -5876,7 +5876,7 @@ collect_regexp:
break;
case ']':
if (in_brack > 0
- && (cur_index == b_index + 1
+ && (cur_index == b_index + 1
|| (cur_index == b_index + 2 && tok[-1] == '^')))
; /* do nothing */
else {
@@ -6055,7 +6055,7 @@ retry:
in_parens--;
return lasttok = c;
- case '(':
+ case '(':
in_parens++;
return lasttok = c;
case '$':
@@ -6158,7 +6158,7 @@ retry:
did_warn_op = true;
warning(_("operator `^' is not supported in old awk"));
}
- yylval = GET_INSTRUCTION(Op_exp);
+ yylval = GET_INSTRUCTION(Op_exp);
return lasttok = '^';
}
@@ -6281,7 +6281,7 @@ retry:
yylval->lextok = estrdup(tokstart, tok - tokstart);
return lasttok = FILENAME;
}
-
+
yylval->opcode = Op_push_i;
yylval->memory = make_str_node(tokstart,
tok - tokstart, esc_seen ? SCAN : 0);
@@ -6613,7 +6613,7 @@ retry:
case LEX_BEGIN:
case LEX_END:
case LEX_BEGINFILE:
- case LEX_ENDFILE:
+ case LEX_ENDFILE:
yylval = bcalloc(tokentab[mid].value, 3, sourceline);
break;
@@ -6662,7 +6662,7 @@ out:
tokkey = estrdup(tokstart, tok - tokstart);
if (*lexptr == '(') {
yylval = bcalloc(Op_token, 2, sourceline);
- yylval->lextok = tokkey;
+ yylval->lextok = tokkey;
return lasttok = FUNC_CALL;
} else {
static bool goto_warned = false;
@@ -6738,7 +6738,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
nexp++;
}
assert(nexp > 0);
- }
+ }
/* check against how many args. are allowed for this builtin */
args_allowed = tokentab[idx].flags & ARGS;
@@ -6809,7 +6809,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
subn->lasti->assign_ctxt = Op_sub_builtin;
}
- return subn;
+ return subn;
} else {
/* gensub */
@@ -6838,16 +6838,16 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
/* special case processing for a few builtins */
if (r->builtin == do_length) {
- if (nexp == 0) {
+ if (nexp == 0) {
/* no args. Use $0 */
INSTRUCTION *list;
- r->expr_count = 1;
+ r->expr_count = 1;
list = list_create(r);
(void) list_prepend(list, instruction(Op_field_spec));
(void) list_prepend(list, instruction(Op_push_i));
list->nexti->memory = make_profile_number(0.0, "0", 1);
- return list;
+ return list;
} else {
arg = subn->nexti;
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
@@ -7190,7 +7190,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
return fi;
}
-/*
+/*
* install_function:
* install function name in the symbol table.
* Extra work, build up and install a list of the parameter names.
@@ -7214,7 +7214,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist)
fi->func_body = f;
f->param_cnt = pcount;
f->code_ptr = fi;
- f->fparms = NULL;
+ f->fparms = NULL;
if (pcount > 0) {
char **pnames;
pnames = check_params(fname, pcount, plist); /* frees plist */
@@ -7271,7 +7271,7 @@ check_params(char *fname, int pcount, INSTRUCTION *list)
}
bcfree(list);
- return pnames;
+ return pnames;
}
@@ -7279,7 +7279,7 @@ check_params(char *fname, int pcount, INSTRUCTION *list)
undef HASHSIZE
#endif
#define HASHSIZE 1021
-
+
static struct fdesc {
char *name;
short used;
@@ -7341,7 +7341,7 @@ check_funcs()
if (! in_main_context())
goto free_mem;
-
+
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
#ifdef REALLYMEAN
@@ -7681,7 +7681,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
break;
default:
goto regular;
- }
+ }
op->memory = ip2->memory;
bcfree(ip2);
@@ -7697,7 +7697,7 @@ regular:
}
/* mk_boolean --- instructions for boolean and, or */
-
+
static INSTRUCTION *
mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op)
{
@@ -7725,7 +7725,7 @@ mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op)
right->lasti->target_stmt = left->lasti;
} else { /* optimization for x || y || z || ... */
INSTRUCTION *ip;
-
+
op->opcode = final_opc;
(void) list_append(right, op);
op->target_stmt = tp;
@@ -7762,7 +7762,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
*
* ----------------
* [Op_jmp y]
- * ----------------
+ * ----------------
* f:
* false_branch
* ----------------
@@ -7924,7 +7924,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
rule_block[rule] = ip;
else
(void) list_merge(rule_block[rule], ip);
-
+
return rule_block[rule];
}
@@ -7946,7 +7946,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
break;
case Op_push:
case Op_push_array:
- tp->opcode = Op_push_lhs;
+ tp->opcode = Op_push_lhs;
break;
case Op_field_assign:
yyerror(_("cannot assign a value to the result of a field post-increment expression"));
@@ -8001,7 +8001,7 @@ optimize_assignment(INSTRUCTION *exp)
* Replaces Op_push_array + Op_subscript_lhs + Op_assign + Op_pop
* with single instruction Op_store_sub.
* Limitation: 1 dimension and sub is simple var/value.
- *
+ *
* 2) Simple variable assignment var = x:
* Replaces Op_push_lhs + Op_assign + Op_pop with Op_store_var.
*
@@ -8025,7 +8025,7 @@ optimize_assignment(INSTRUCTION *exp)
i1 = exp->lasti;
if ( i1->opcode != Op_assign
- && i1->opcode != Op_field_assign)
+ && i1->opcode != Op_field_assign)
return list_append(exp, instruction(Op_pop));
for (i2 = exp->nexti; i2 != i1; i2 = i2->nexti) {
@@ -8100,7 +8100,7 @@ optimize_assignment(INSTRUCTION *exp)
* so use expr_count instead.
*/
i3->nexti = NULL;
- i2->opcode = Op_no_op;
+ i2->opcode = Op_no_op;
bcfree(i1); /* Op_assign */
exp->lasti = i3; /* update Op_list */
return exp;
@@ -8123,7 +8123,7 @@ optimize_assignment(INSTRUCTION *exp)
&& (i3->memory->flags & INTLSTR) == 0
&& i3->nexti == i2
) {
- /* constant initializer */
+ /* constant initializer */
i2->initval = i3->memory;
bcfree(i3);
exp->nexti = i2;
@@ -8159,7 +8159,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
* [ file (simp_exp)]
* [ [ var ] ]
* [ Op_K_getline_redir|NULL|redir_type|into_var]
- * [ [var_assign] ]
+ * [ [var_assign] ]
*
*/
@@ -8168,7 +8168,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
bcfree(op);
op = bcalloc(Op_K_getline, 2, sline);
(op + 1)->target_endfile = ip_endfile;
- (op + 1)->target_beginfile = ip_beginfile;
+ (op + 1)->target_beginfile = ip_beginfile;
}
if (var != NULL) {
@@ -8226,11 +8226,11 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
* ------------------------
* body (may be NULL)
* ------------------------
- * tc:
+ * tc:
* incr (may be NULL)
- * [ Op_jmp x ]
+ * [ Op_jmp x ]
* ------------------------
- * tb:[ Op_no_op ]
+ * tb:[ Op_no_op ]
*/
INSTRUCTION *ip, *tbreak, *tcont;
@@ -8342,7 +8342,7 @@ mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1)
/* we can't just combine all bytecodes, since we need to
* process individual expressions for a few builtins in snode() (-:
*/
-
+
/* -- list of lists */
/* [Op_list| ... ]------
* |
@@ -8398,7 +8398,7 @@ count_expressions(INSTRUCTION **list, bool isarg)
(void) list_merge(r, expr);
expr = t2->nexti;
}
-
+
assert(count > 0);
if (! isarg && count > max_args)
max_args = count;
@@ -8664,7 +8664,7 @@ install_builtins(void)
* The scene of the murder was grisly to look upon. When the inspector
* arrived, the sergeant turned to him and said, "Another programmer stabbed
* in the back. He never knew what happened."
- *
+ *
* The inspector replied, "Looks like the MO of isalpha, and his even meaner
* big brother, isalnum. The Locale brothers." The sergeant merely
* shuddered in horror.
diff --git a/awkgram.y b/awkgram.y
index 11cc2fb1..3a3fce31 100644
--- a/awkgram.y
+++ b/awkgram.y
@@ -2,7 +2,7 @@
* awkgram.y --- yacc/bison parser
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
@@ -40,7 +40,7 @@ static void lintwarn_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
static void warning_ln(int line, const char *m, ...) ATTRIBUTE_PRINTF_2;
static char *get_src_buf(void);
static int yylex(void);
-int yyparse(void);
+int yyparse(void);
static INSTRUCTION *snode(INSTRUCTION *subn, INSTRUCTION *op);
static char **check_params(char *fname, int pcount, INSTRUCTION *list);
static int install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist);
@@ -115,7 +115,7 @@ static char *lexptr; /* pointer to next char during parsing */
static char *lexend; /* end of buffer */
static char *lexptr_begin; /* keep track of where we were for error msgs */
static char *lexeme; /* beginning of lexeme for debugging */
-static bool lexeof; /* seen EOF for current source? */
+static bool lexeof; /* seen EOF for current source? */
static char *thisline = NULL;
static int in_braces = 0; /* count braces for firstline, lastline in an 'action' */
static int lastline = 0;
@@ -181,7 +181,7 @@ extern double fmod(double x, double y);
%token LEX_BEGIN LEX_END LEX_IF LEX_ELSE LEX_RETURN LEX_DELETE
%token LEX_SWITCH LEX_CASE LEX_DEFAULT LEX_WHILE LEX_DO LEX_FOR LEX_BREAK LEX_CONTINUE
%token LEX_PRINT LEX_PRINTF LEX_NEXT LEX_EXIT LEX_FUNCTION
-%token LEX_BEGINFILE LEX_ENDFILE
+%token LEX_BEGINFILE LEX_ENDFILE
%token LEX_GETLINE LEX_NEXTFILE
%token LEX_IN
%token LEX_AND LEX_OR INCREMENT DECREMENT
@@ -322,7 +322,7 @@ pattern
} else
$$ = $1;
}
-
+
| exp ',' opt_nls exp
{
INSTRUCTION *tp;
@@ -433,7 +433,7 @@ lex_builtin
: LEX_BUILTIN
| LEX_LENGTH
;
-
+
function_prologue
: LEX_FUNCTION func_name '(' { want_param_names = FUNC_HEADER; } opt_param_list r_paren opt_nls
{
@@ -630,7 +630,7 @@ statement
int case_count = 0;
int i;
- tbreak = instruction(Op_no_op);
+ tbreak = instruction(Op_no_op);
cstmt = list_create(tbreak);
cexp = list_create(instruction(Op_pop));
dflt = instruction(Op_jmp);
@@ -657,7 +657,7 @@ statement
error_ln(curr->source_line,
_("duplicate case values in switch body: %s"), caseval);
}
-
+
if (case_values == NULL)
emalloc(case_values, const char **, sizeof(char *) * maxcount, "statement");
else if (case_count >= maxcount) {
@@ -708,18 +708,18 @@ statement
(void) list_merge(ip, cexp);
$$ = list_merge(ip, cstmt);
- break_allowed--;
+ break_allowed--;
fix_break_continue(ip, tbreak, NULL);
}
| LEX_WHILE '(' exp r_paren opt_nls statement
- {
+ {
/*
* -----------------
* tc:
* cond
* -----------------
* [Op_jmp_false tb ]
- * -----------------
+ * -----------------
* body
* -----------------
* [Op_jmp tc ]
@@ -760,7 +760,7 @@ statement
* z:
* body
* -----------------
- * tc:
+ * tc:
* cond
* -----------------
* [Op_jmp_true | z ]
@@ -807,7 +807,7 @@ statement
&& ($8->nexti->memory->type != Node_var || !($8->nexti->memory->var_update))
&& strcmp($8->nexti->memory->vname, var_name) == 0
) {
-
+
/* Efficiency hack. Recognize the special case of
*
* for (iggy in foo)
@@ -819,10 +819,10 @@ statement
*
* Check that the body is a `delete a[i]' statement,
* and that both the loop var and array names match.
- */
+ */
NODE *arr = NULL;
- ip = $8->nexti->nexti;
+ ip = $8->nexti->nexti;
if ($5->nexti->opcode == Op_push && $5->lasti == $5->nexti)
arr = $5->nexti->memory;
if (arr != NULL
@@ -848,7 +848,7 @@ statement
/* [ Op_push_array a ]
* [ Op_arrayfor_init | ib ]
- * ic:[ Op_arrayfor_incr | ib ]
+ * ic:[ Op_arrayfor_incr | ib ]
* [ Op_var_assign if any ]
*
* body
@@ -877,7 +877,7 @@ regular_loop:
} /* else
$1 is NULL */
- /* add update_FOO instruction if necessary */
+ /* add update_FOO instruction if necessary */
if ($4->array_var->type == Node_var && $4->array_var->var_update) {
(void) list_append(ip, instruction(Op_var_update));
ip->lasti->update_var = $4->array_var->var_update;
@@ -893,7 +893,7 @@ regular_loop:
if (do_pretty_print) {
(void) list_append(ip, instruction(Op_exec_count));
($1 + 1)->forloop_cond = $4;
- ($1 + 1)->forloop_body = ip->lasti;
+ ($1 + 1)->forloop_body = ip->lasti;
}
if ($8 != NULL)
@@ -903,7 +903,7 @@ regular_loop:
ip->lasti->target_jmp = $4;
$$ = list_append(ip, tbreak);
fix_break_continue(ip, tbreak, tcont);
- }
+ }
break_allowed--;
continue_allowed--;
@@ -934,7 +934,7 @@ regular_loop:
non_compound_stmt
: LEX_BREAK statement_term
- {
+ {
if (! break_allowed)
error_ln($1->source_line,
_("`break' is not allowed outside a loop or switch"));
@@ -978,7 +978,7 @@ non_compound_stmt
| LEX_EXIT opt_exp statement_term
{
/* Initialize the two possible jump targets, the actual target
- * is resolved at run-time.
+ * is resolved at run-time.
*/
$1->target_end = ip_end; /* first instruction in end_block */
$1->target_atexit = ip_atexit; /* cleanup and go home */
@@ -1096,7 +1096,7 @@ simple_stmt
* [$1 | NULL | redir_type | expr_count]
*
*/
-regular_print:
+regular_print:
if ($4 == NULL) { /* no redirection */
if ($3 == NULL) { /* printf without arg */
$1->expr_count = 0;
@@ -1160,7 +1160,7 @@ regular_print:
$$ = list_append(list_append($4, $2), $1);
}
$$ = add_pending_comment($$);
- }
+ }
| LEX_DELETE '(' NAME ')'
/*
* this is for tawk compatibility. maybe the warnings
@@ -1225,7 +1225,7 @@ case_statement
{
INSTRUCTION *casestmt = $5;
if ($5 == NULL)
- casestmt = list_create(instruction(Op_no_op));
+ casestmt = list_create(instruction(Op_no_op));
if (do_pretty_print)
(void) list_prepend(casestmt, instruction(Op_exec_count));
$1->case_exp = $2;
@@ -1250,7 +1250,7 @@ case_value
: YNUMBER
{ $$ = $1; }
| '-' YNUMBER %prec UNARY
- {
+ {
NODE *n = $2->memory;
(void) force_number(n);
negate_num(n);
@@ -1264,9 +1264,9 @@ case_value
add_sign_to_num(n, '+');
$$ = $2;
}
- | YSTRING
+ | YSTRING
{ $$ = $1; }
- | regexp
+ | regexp
{
if ($1->memory->type == Node_regex)
$1->opcode = Op_push_re;
@@ -1543,7 +1543,7 @@ assign_operator
| ASSIGNOP
{ $$ = $1; }
| SLASH_BEFORE_EQUAL ASSIGN /* `/=' */
- {
+ {
$2->opcode = Op_assign_quotient;
$$ = $2;
}
@@ -1798,7 +1798,7 @@ non_post_simp_exp
) {
NODE *n = $2->lasti->memory;
(void) force_number(n);
- negate_num(n);
+ negate_num(n);
$$ = $2;
bcfree($1);
} else {
@@ -1847,7 +1847,7 @@ func_call
warned = true;
lintwarn("%s", msg);
}
-
+
f = $2->lasti;
f->opcode = Op_indirect_func_call;
name = estrdup(f->func_name, strlen(f->func_name));
@@ -1890,7 +1890,7 @@ direct_func_call
$$ = list_create($1);
} else {
INSTRUCTION *t = $3;
- ($1 + 1)->expr_count = count_expressions(&t, true);
+ ($1 + 1)->expr_count = count_expressions(&t, true);
$$ = list_append(t, $1);
}
}
@@ -1922,7 +1922,7 @@ delete_subscript
delete_exp_list
: bracketed_exp_list
{
- INSTRUCTION *ip = $1->lasti;
+ INSTRUCTION *ip = $1->lasti;
int count = ip->sub_count; /* # of SUBSEP-seperated expressions */
if (count > 1) {
/* change Op_subscript or Op_sub_array to Op_concat */
@@ -1946,7 +1946,7 @@ bracketed_exp_list
/* install Null string as subscript. */
t = list_create(instruction(Op_push_i));
t->nexti->memory = dupnode(Nnull_string);
- $3->sub_count = 1;
+ $3->sub_count = 1;
} else
$3->sub_count = count_expressions(&t, false);
$$ = list_append(t, $3);
@@ -2062,7 +2062,7 @@ struct token {
# define BREAK 0x0800 /* break allowed inside */
# define CONTINUE 0x1000 /* continue allowed inside */
# define DEBUG_USE 0x2000 /* for use by developers */
-
+
NODE *(*ptr)(int); /* function that implements this keyword */
NODE *(*ptr2)(int); /* alternate arbitrary-precision function */
};
@@ -2194,7 +2194,7 @@ getfname(NODE *(*fptr)(int))
j = sizeof(tokentab) / sizeof(tokentab[0]);
/* linear search, no other way to do it */
- for (i = 0; i < j; i++)
+ for (i = 0; i < j; i++)
if (tokentab[i].ptr == fptr || tokentab[i].ptr2 == fptr)
return tokentab[i].operator;
@@ -2267,7 +2267,7 @@ print_included_from()
int saveline, line;
SRCFILE *s;
- /* suppress current file name, line # from `.. included from ..' msgs */
+ /* suppress current file name, line # from `.. included from ..' msgs */
saveline = sourceline;
sourceline = 0;
@@ -2468,7 +2468,7 @@ mk_program()
if (prog_block == NULL) {
if (end_block->nexti == end_block->lasti
- && beginfile_block->nexti == beginfile_block->lasti
+ && beginfile_block->nexti == beginfile_block->lasti
&& endfile_block->nexti == endfile_block->lasti
) {
/* no pattern-action and (real) end, beginfile or endfile blocks */
@@ -2485,7 +2485,7 @@ mk_program()
cp = list_merge(begin_block, end_block);
if (program_comment != NULL) {
(void) list_prepend(cp, program_comment);
- }
+ }
if (comment != NULL)
(void) list_append(cp, comment);
(void) list_append(cp, ip_atexit);
@@ -2510,7 +2510,7 @@ mk_program()
(void) list_prepend(prog_block, ip_rec);
(void) list_append(prog_block, instruction(Op_jmp));
prog_block->lasti->target_jmp = ip_rec;
-
+
list_append(beginfile_block, instruction(Op_after_beginfile));
cp = list_merge(beginfile_block, prog_block);
@@ -2522,10 +2522,10 @@ mk_program()
if (program_comment != NULL) {
(void) list_prepend(cp, program_comment);
- }
+ }
if (comment != NULL) {
(void) list_append(cp, comment);
- }
+ }
(void) list_append(cp, ip_atexit);
(void) list_append(cp, instruction(Op_stop));
@@ -2543,7 +2543,7 @@ out:
#undef end_block
#undef prog_block
#undef beginfile_block
-#undef endfile_block
+#undef endfile_block
}
/* parse_program --- read in the program and convert into a list of instructions */
@@ -2694,7 +2694,7 @@ add_srcfile(enum srctype stype, char *src, SRCFILE *thisfile, bool *already_incl
*already_included = true;
return NULL;
} else {
- /* duplicates are allowed for -f */
+ /* duplicates are allowed for -f */
if (s->stype == SRC_INC)
fatal(_("can't include `%s' and use it as a program file"), src);
/* no need to scan for further matches, since
@@ -2745,11 +2745,11 @@ include_source(INSTRUCTION *file)
sourcefile->srclines = sourceline;
sourcefile->lexptr = lexptr;
sourcefile->lexend = lexend;
- sourcefile->lexptr_begin = lexptr_begin;
+ sourcefile->lexptr_begin = lexptr_begin;
sourcefile->lexeme = lexeme;
sourcefile->lasttok = lasttok;
- /* included file becomes the current source */
+ /* included file becomes the current source */
sourcefile = s;
lexptr = NULL;
sourceline = 0;
@@ -3056,7 +3056,7 @@ tokexpand()
{
static int toksize;
int tokoffset;
-
+
if (tokstart != NULL) {
tokoffset = tok - tokstart;
toksize *= 2;
@@ -3124,7 +3124,7 @@ again:
int idx, work_ring_idx = cur_ring_idx;
mbstate_t tmp_state;
size_t mbclen;
-
+
for (idx = 0; lexptr + idx < lexend; idx++) {
tmp_state = cur_mbstate;
mbclen = mbrlen(lexptr, idx + 1, &tmp_state);
@@ -3190,7 +3190,7 @@ check_comment(void)
if (comment != NULL) {
if (first_rule) {
program_comment = comment;
- } else
+ } else
block_comment = comment;
comment = NULL;
}
@@ -3392,7 +3392,7 @@ yylex(void)
lasttok = 0;
return SUBSCRIPT;
}
-
+
if (lasttok == LEX_EOF) /* error earlier in current source, must give up !! */
return 0;
@@ -3427,7 +3427,7 @@ collect_regexp:
*
* [..[..] []] [^]] [.../...]
* [...\[...] [...\]...] [...\/...]
- *
+ *
* (Remember that all of the above are inside /.../)
*
* The code for \ handles \[, \] and \/.
@@ -3456,7 +3456,7 @@ collect_regexp:
break;
case ']':
if (in_brack > 0
- && (cur_index == b_index + 1
+ && (cur_index == b_index + 1
|| (cur_index == b_index + 2 && tok[-1] == '^')))
; /* do nothing */
else {
@@ -3635,7 +3635,7 @@ retry:
in_parens--;
return lasttok = c;
- case '(':
+ case '(':
in_parens++;
return lasttok = c;
case '$':
@@ -3738,7 +3738,7 @@ retry:
did_warn_op = true;
warning(_("operator `^' is not supported in old awk"));
}
- yylval = GET_INSTRUCTION(Op_exp);
+ yylval = GET_INSTRUCTION(Op_exp);
return lasttok = '^';
}
@@ -3861,7 +3861,7 @@ retry:
yylval->lextok = estrdup(tokstart, tok - tokstart);
return lasttok = FILENAME;
}
-
+
yylval->opcode = Op_push_i;
yylval->memory = make_str_node(tokstart,
tok - tokstart, esc_seen ? SCAN : 0);
@@ -4193,7 +4193,7 @@ retry:
case LEX_BEGIN:
case LEX_END:
case LEX_BEGINFILE:
- case LEX_ENDFILE:
+ case LEX_ENDFILE:
yylval = bcalloc(tokentab[mid].value, 3, sourceline);
break;
@@ -4242,7 +4242,7 @@ out:
tokkey = estrdup(tokstart, tok - tokstart);
if (*lexptr == '(') {
yylval = bcalloc(Op_token, 2, sourceline);
- yylval->lextok = tokkey;
+ yylval->lextok = tokkey;
return lasttok = FUNC_CALL;
} else {
static bool goto_warned = false;
@@ -4318,7 +4318,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
nexp++;
}
assert(nexp > 0);
- }
+ }
/* check against how many args. are allowed for this builtin */
args_allowed = tokentab[idx].flags & ARGS;
@@ -4389,7 +4389,7 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
subn->lasti->assign_ctxt = Op_sub_builtin;
}
- return subn;
+ return subn;
} else {
/* gensub */
@@ -4418,16 +4418,16 @@ snode(INSTRUCTION *subn, INSTRUCTION *r)
/* special case processing for a few builtins */
if (r->builtin == do_length) {
- if (nexp == 0) {
+ if (nexp == 0) {
/* no args. Use $0 */
INSTRUCTION *list;
- r->expr_count = 1;
+ r->expr_count = 1;
list = list_create(r);
(void) list_prepend(list, instruction(Op_field_spec));
(void) list_prepend(list, instruction(Op_push_i));
list->nexti->memory = make_profile_number(0.0, "0", 1);
- return list;
+ return list;
} else {
arg = subn->nexti;
if (arg->nexti == arg->lasti && arg->nexti->opcode == Op_push)
@@ -4770,7 +4770,7 @@ mk_function(INSTRUCTION *fi, INSTRUCTION *def)
return fi;
}
-/*
+/*
* install_function:
* install function name in the symbol table.
* Extra work, build up and install a list of the parameter names.
@@ -4794,7 +4794,7 @@ install_function(char *fname, INSTRUCTION *fi, INSTRUCTION *plist)
fi->func_body = f;
f->param_cnt = pcount;
f->code_ptr = fi;
- f->fparms = NULL;
+ f->fparms = NULL;
if (pcount > 0) {
char **pnames;
pnames = check_params(fname, pcount, plist); /* frees plist */
@@ -4851,7 +4851,7 @@ check_params(char *fname, int pcount, INSTRUCTION *list)
}
bcfree(list);
- return pnames;
+ return pnames;
}
@@ -4859,7 +4859,7 @@ check_params(char *fname, int pcount, INSTRUCTION *list)
undef HASHSIZE
#endif
#define HASHSIZE 1021
-
+
static struct fdesc {
char *name;
short used;
@@ -4921,7 +4921,7 @@ check_funcs()
if (! in_main_context())
goto free_mem;
-
+
for (i = 0; i < HASHSIZE; i++) {
for (fp = ftable[i]; fp != NULL; fp = fp->next) {
#ifdef REALLYMEAN
@@ -5261,7 +5261,7 @@ mk_binary(INSTRUCTION *s1, INSTRUCTION *s2, INSTRUCTION *op)
break;
default:
goto regular;
- }
+ }
op->memory = ip2->memory;
bcfree(ip2);
@@ -5277,7 +5277,7 @@ regular:
}
/* mk_boolean --- instructions for boolean and, or */
-
+
static INSTRUCTION *
mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op)
{
@@ -5305,7 +5305,7 @@ mk_boolean(INSTRUCTION *left, INSTRUCTION *right, INSTRUCTION *op)
right->lasti->target_stmt = left->lasti;
} else { /* optimization for x || y || z || ... */
INSTRUCTION *ip;
-
+
op->opcode = final_opc;
(void) list_append(right, op);
op->target_stmt = tp;
@@ -5342,7 +5342,7 @@ mk_condition(INSTRUCTION *cond, INSTRUCTION *ifp, INSTRUCTION *true_branch,
*
* ----------------
* [Op_jmp y]
- * ----------------
+ * ----------------
* f:
* false_branch
* ----------------
@@ -5504,7 +5504,7 @@ append_rule(INSTRUCTION *pattern, INSTRUCTION *action)
rule_block[rule] = ip;
else
(void) list_merge(rule_block[rule], ip);
-
+
return rule_block[rule];
}
@@ -5526,7 +5526,7 @@ mk_assignment(INSTRUCTION *lhs, INSTRUCTION *rhs, INSTRUCTION *op)
break;
case Op_push:
case Op_push_array:
- tp->opcode = Op_push_lhs;
+ tp->opcode = Op_push_lhs;
break;
case Op_field_assign:
yyerror(_("cannot assign a value to the result of a field post-increment expression"));
@@ -5581,7 +5581,7 @@ optimize_assignment(INSTRUCTION *exp)
* Replaces Op_push_array + Op_subscript_lhs + Op_assign + Op_pop
* with single instruction Op_store_sub.
* Limitation: 1 dimension and sub is simple var/value.
- *
+ *
* 2) Simple variable assignment var = x:
* Replaces Op_push_lhs + Op_assign + Op_pop with Op_store_var.
*
@@ -5605,7 +5605,7 @@ optimize_assignment(INSTRUCTION *exp)
i1 = exp->lasti;
if ( i1->opcode != Op_assign
- && i1->opcode != Op_field_assign)
+ && i1->opcode != Op_field_assign)
return list_append(exp, instruction(Op_pop));
for (i2 = exp->nexti; i2 != i1; i2 = i2->nexti) {
@@ -5680,7 +5680,7 @@ optimize_assignment(INSTRUCTION *exp)
* so use expr_count instead.
*/
i3->nexti = NULL;
- i2->opcode = Op_no_op;
+ i2->opcode = Op_no_op;
bcfree(i1); /* Op_assign */
exp->lasti = i3; /* update Op_list */
return exp;
@@ -5703,7 +5703,7 @@ optimize_assignment(INSTRUCTION *exp)
&& (i3->memory->flags & INTLSTR) == 0
&& i3->nexti == i2
) {
- /* constant initializer */
+ /* constant initializer */
i2->initval = i3->memory;
bcfree(i3);
exp->nexti = i2;
@@ -5739,7 +5739,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
* [ file (simp_exp)]
* [ [ var ] ]
* [ Op_K_getline_redir|NULL|redir_type|into_var]
- * [ [var_assign] ]
+ * [ [var_assign] ]
*
*/
@@ -5748,7 +5748,7 @@ mk_getline(INSTRUCTION *op, INSTRUCTION *var, INSTRUCTION *redir, int redirtype)
bcfree(op);
op = bcalloc(Op_K_getline, 2, sline);
(op + 1)->target_endfile = ip_endfile;
- (op + 1)->target_beginfile = ip_beginfile;
+ (op + 1)->target_beginfile = ip_beginfile;
}
if (var != NULL) {
@@ -5806,11 +5806,11 @@ mk_for_loop(INSTRUCTION *forp, INSTRUCTION *init, INSTRUCTION *cond,
* ------------------------
* body (may be NULL)
* ------------------------
- * tc:
+ * tc:
* incr (may be NULL)
- * [ Op_jmp x ]
+ * [ Op_jmp x ]
* ------------------------
- * tb:[ Op_no_op ]
+ * tb:[ Op_no_op ]
*/
INSTRUCTION *ip, *tbreak, *tcont;
@@ -5922,7 +5922,7 @@ mk_expression_list(INSTRUCTION *list, INSTRUCTION *s1)
/* we can't just combine all bytecodes, since we need to
* process individual expressions for a few builtins in snode() (-:
*/
-
+
/* -- list of lists */
/* [Op_list| ... ]------
* |
@@ -5978,7 +5978,7 @@ count_expressions(INSTRUCTION **list, bool isarg)
(void) list_merge(r, expr);
expr = t2->nexti;
}
-
+
assert(count > 0);
if (! isarg && count > max_args)
max_args = count;
@@ -6244,7 +6244,7 @@ install_builtins(void)
* The scene of the murder was grisly to look upon. When the inspector
* arrived, the sergeant turned to him and said, "Another programmer stabbed
* in the back. He never knew what happened."
- *
+ *
* The inspector replied, "Looks like the MO of isalpha, and his even meaner
* big brother, isalnum. The Locale brothers." The sergeant merely
* shuddered in horror.
diff --git a/awklib/eg/lib/grcat.c b/awklib/eg/lib/grcat.c
index cf39083c..30e81cca 100644
--- a/awklib/eg/lib/grcat.c
+++ b/awklib/eg/lib/grcat.c
@@ -9,7 +9,6 @@
* December 2010, move to ANSI C definition for main().
*/
-/* For OS/2, do nothing. */
#if HAVE_CONFIG_H
#include <config.h>
#endif
diff --git a/builtin.c b/builtin.c
index 87f7fb23..9de283bd 100644
--- a/builtin.c
+++ b/builtin.c
@@ -2,22 +2,22 @@
* builtin.c - Builtin functions and various utility procedures.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -193,9 +193,9 @@ do_fflush(int nargs)
/*
* November, 2012.
- * It turns out that circa 2002, when BWK
+ * It turns out that circa 2002, when BWK
* added fflush() and fflush("") to his awk, he made both of
- * them flush everything.
+ * them flush everything.
*
* Now, with our inside agent getting ready to try to get fflush()
* standardized in POSIX, we are going to make our awk consistent
@@ -386,7 +386,7 @@ do_index(int nargs)
* If we don't have valid wide character strings, use
* the real bytes.
*/
- do_single_byte = ((s1->wstlen == 0 && s1->stlen > 0)
+ do_single_byte = ((s1->wstlen == 0 && s1->stlen > 0)
|| (s2->wstlen == 0 && s2->stlen > 0));
}
@@ -521,7 +521,7 @@ do_length(int nargs)
/*
* Support for deferred loading of array elements requires that
- * we use the array length interface even though it isn't
+ * we use the array length interface even though it isn't
* necessary for the built-in array types.
*
* 1/2015: The deferred arrays are gone, but this is probably
@@ -962,7 +962,7 @@ check_pos:
case ' ': /* print ' ' or '-' */
/* 'space' flag is ignored */
/* if '+' already present */
- if (signchar != false)
+ if (signchar != false)
goto check_pos;
/* FALL THROUGH */
case '+': /* print '+' or '-' */
@@ -988,18 +988,18 @@ check_pos:
alt = true;
goto check_pos;
case '\'':
-#if defined(HAVE_LOCALE_H)
+#if defined(HAVE_LOCALE_H)
quote_flag = true;
goto check_pos;
#else
- goto retry;
+ goto retry;
#endif
case 'l':
if (big_flag)
break;
else {
static bool warned = false;
-
+
if (do_lint && ! warned) {
lintwarn(_("`l' is meaningless in awk formats; ignored"));
warned = true;
@@ -1016,7 +1016,7 @@ check_pos:
break;
else {
static bool warned = false;
-
+
if (do_lint && ! warned) {
lintwarn(_("`L' is meaningless in awk formats; ignored"));
warned = true;
@@ -1033,7 +1033,7 @@ check_pos:
break;
else {
static bool warned = false;
-
+
if (do_lint && ! warned) {
lintwarn(_("`h' is meaningless in awk formats; ignored"));
warned = true;
@@ -1219,7 +1219,7 @@ out0:
jj = 0; /* keep using current val in loc.grouping[ii] */
else if (loc.grouping[ii+1] == CHAR_MAX)
quote_flag = false;
- else {
+ else {
ii++;
jj = 0;
}
@@ -1334,7 +1334,7 @@ mpf1:
zero_flag = (! lj
&& ((zero_flag && ! have_prec)
|| (fw == 0 && have_prec)));
-
+
(void) mpfr_get_z(mpzval, mf, MPFR_RNDZ); /* convert to GMP integer */
fmt_type = have_prec ? MP_INT_WITH_PREC : MP_INT_WITHOUT_PREC;
zi = mpzval;
@@ -1399,11 +1399,11 @@ mpf1:
PREPEND(ts[k]);
}
}
- if (loc.grouping[ii+1] == 0)
+ if (loc.grouping[ii+1] == 0)
jj = 0; /* keep using current val in loc.grouping[ii] */
- else if (loc.grouping[ii+1] == CHAR_MAX)
+ else if (loc.grouping[ii+1] == CHAR_MAX)
quote_flag = false;
- else {
+ else {
ii++;
jj = 0;
}
@@ -1964,7 +1964,7 @@ do_strftime(int nargs)
tmp = POP_SCALAR();
if (do_lint && (fixtype(tmp)->flags & STRING) == 0)
lintwarn(_("strftime: received non-string first argument"));
-
+
t1 = force_string(tmp);
format = t1->stptr;
formatlen = t1->stlen;
@@ -2227,7 +2227,7 @@ do_print(int nargs, int redirtype)
/* do_print_rec --- special case printing of $0, for speed */
-void
+void
do_print_rec(int nargs, int redirtype)
{
FILE *fp = NULL;
@@ -2496,11 +2496,11 @@ do_rand(int nargs ATTRIBUTE_UNUSED)
* that when the values of successive values are combined
* like (rand1*rand2)^2, (rand3*rand4)^2, ... the
* resulting time series is not white noise. The
- * following also seems to fix that bug.
+ * following also seems to fix that bug.
*
* The add/subtract 0.5 keeps small bits from filling
* below 2^-53 in the double, not that anyone should be
- * looking down there.
+ * looking down there.
*
* Date: Wed, 25 Sep 2013 10:45:38 -0600 (MDT)
* From: "Nelson H. F. Beebe" <beebe@math.utah.edu>
@@ -2508,32 +2508,32 @@ do_rand(int nargs ATTRIBUTE_UNUSED)
* from integer to floating-point, and I discuss the serious pitfalls
* in my book, because it leads to platform-dependent behavior at the
* end points of the interval [0,1]
- *
+ *
* (5) the documentation in the gawk info node says
- *
+ *
* `rand()'
* Return a random number. The values of `rand()' are uniformly
* distributed between zero and one. The value could be zero but is
* never one.(1)
- *
+ *
* The division by RAND_DIVISOR may not guarantee that 1.0 is never
* returned: the programmer forgot the platform-dependent issue of
* rounding.
- *
+ *
* For points 4 and 5, the safe way is a loop:
- *
- * double
+ *
+ * double
* rand(void) // return value in [0.0, 1.0)
* {
* value = internal_rand();
*
- * while (value == 1.0)
+ * while (value == 1.0)
* value = internal_rand();
- *
+ *
* return (value);
* }
*/
-
+
do {
long d1, d2;
/*
@@ -2607,7 +2607,7 @@ do_match(int nargs)
tre = POP();
rp = re_update(tre);
t1 = POP_STRING();
-
+
rstart = research(rp, t1->stptr, 0, t1->stlen, RE_NEED_START);
if (rstart >= 0) { /* match succeded */
size_t *wc_indices = NULL;
@@ -2620,7 +2620,7 @@ do_match(int nargs)
}
rstart++; /* now it's 1-based indexing */
-
+
/* Build the array only if the caller wants the optional subpatterns */
if (dest != NULL) {
subsepstr = SUBSEP_node->var_value->stptr;
@@ -2636,7 +2636,7 @@ do_match(int nargs)
size_t subpat_len;
NODE **lhs;
NODE *sub;
-
+
start = t1->stptr + s;
subpat_start = s;
subpat_len = len = SUBPATEND(rp, t1->stptr, ii) - s;
@@ -2644,7 +2644,7 @@ do_match(int nargs)
subpat_start = wc_indices[s];
subpat_len = wc_indices[s + len - 1] - subpat_start + 1;
}
-
+
it = make_string(start, len);
it->flags |= MAYBE_NUM; /* user input */
@@ -2660,7 +2660,7 @@ do_match(int nargs)
sprintf(buff, "%d", ii);
ilen = strlen(buff);
amt = ilen + subseplen + strlen("length") + 1;
-
+
if (oldamt == 0) {
emalloc(buf, char *, amt, "do_match");
} else if (amt > oldamt) {
@@ -2670,9 +2670,9 @@ do_match(int nargs)
memcpy(buf, buff, ilen);
memcpy(buf + ilen, subsepstr, subseplen);
memcpy(buf + ilen + subseplen, "start", 6);
-
+
slen = ilen + subseplen + 5;
-
+
it = make_number((AWKNUM) subpat_start + 1);
sub = make_string(buf, slen);
lhs = assoc_lookup(dest, sub);
@@ -2681,13 +2681,13 @@ do_match(int nargs)
if (dest->astore != NULL)
(*dest->astore)(dest, sub);
unref(sub);
-
+
memcpy(buf, buff, ilen);
memcpy(buf + ilen, subsepstr, subseplen);
memcpy(buf + ilen + subseplen, "length", 7);
-
+
slen = ilen + subseplen + 6;
-
+
it = make_number((AWKNUM) subpat_len);
sub = make_string(buf, slen);
lhs = assoc_lookup(dest, sub);
@@ -2722,9 +2722,9 @@ do_match(int nargs)
* Gsub can be tricksy; particularly when handling the case of null strings.
* The following awk code was useful in debugging problems. It is too bad
* that it does not readily translate directly into the C code, below.
- *
+ *
* #! /usr/local/bin/mawk -f
- *
+ *
* BEGIN {
* true = 1; false = 0
* print "--->", mygsub("abc", "b+", "FOO")
@@ -2734,7 +2734,7 @@ do_match(int nargs)
* print "--->", mygsub("abc", "c+", "X")
* print "--->", mygsub("abc", "x*$", "X")
* }
- *
+ *
* function mygsub(str, regex, replace, origstr, newstr, eosflag, nonzeroflag)
* {
* origstr = str;
@@ -2772,7 +2772,7 @@ do_match(int nargs)
* }
* if (length(str) > 0)
* newstr = newstr str # rest of string
- *
+ *
* return newstr
* }
*/
@@ -2784,7 +2784,7 @@ do_match(int nargs)
*
* The relevant text is to be found on lines 6394-6407 (pages 166, 167) of the
* 2001 standard:
- *
+ *
* sub(ere, repl[, in ])
* Substitute the string repl in place of the first instance of the
* extended regular expression ERE in string in and return the number of
@@ -2842,7 +2842,7 @@ do_sub(int nargs, unsigned int flags)
long current;
bool lastmatchnonzero;
char *mb_indices = NULL;
-
+
if ((flags & GENSUB) != 0) {
double d;
NODE *glob_flag;
@@ -3048,7 +3048,7 @@ do_sub(int nargs, unsigned int flags)
int dig = scan[1] - '0';
if (dig < NUMSUBPATS(rp, target->stptr) && SUBPATSTART(rp, tp->stptr, dig) != -1) {
char *start, *end;
-
+
start = target->stptr
+ SUBPATSTART(rp, target->stptr, dig);
end = target->stptr
@@ -3142,7 +3142,7 @@ done:
DEREF(rep_node);
if ((matches == 0 || (flags & LITERAL) != 0) && buf != NULL) {
- efree(buf);
+ efree(buf);
buf = NULL;
}
@@ -3151,7 +3151,7 @@ done:
/* return the result string */
DEREF(target);
assert(buf != NULL);
- return make_str_node(buf, textlen, ALREADY_MALLOCED);
+ return make_str_node(buf, textlen, ALREADY_MALLOCED);
}
/* return the original string */
@@ -3163,7 +3163,7 @@ done:
DEREF(target);
else if (matches > 0) {
unref(*lhs);
- *lhs = make_str_node(buf, textlen, ALREADY_MALLOCED);
+ *lhs = make_str_node(buf, textlen, ALREADY_MALLOCED);
}
return make_number((AWKNUM) matches);
diff --git a/cint_array.c b/cint_array.c
index 7a92cb0d..092ce88a 100644
--- a/cint_array.c
+++ b/cint_array.c
@@ -2,23 +2,23 @@
* cint_array.c - routines for arrays of (mostly) consecutive positive integer indices.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2013, 2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -37,7 +37,7 @@ extern NODE **is_integer(NODE *symbol, NODE *subs);
* THRESHOLD --- Maximum capacity waste; THRESHOLD >= 2^(NHAT + 1).
*/
-static int NHAT = 10;
+static int NHAT = 10;
static long THRESHOLD;
/*
@@ -102,7 +102,7 @@ static void leaf_info(NODE *array, NODE *ndump, const char *aname);
static void leaf_print(NODE *array, size_t bi, int indent_level);
#endif
-/* powers of 2 table upto 2^30 */
+/* powers of 2 table upto 2^30 */
static const long power_two_table[] = {
1, 2, 4, 8, 16, 32, 64,
128, 256, 512, 1024, 2048, 4096,
@@ -118,7 +118,7 @@ static const long power_two_table[] = {
/*
* To store 2^n integers, allocate top-level array of size n, elements
* of which are 1-Dimensional (leaf-array) of geometrically increasing
- * size (power of 2).
+ * size (power of 2).
*
* [0] --> [ 0 ]
* [1] --> [ 1 ]
@@ -128,7 +128,7 @@ static const long power_two_table[] = {
* |k| --> [ 2^(k - 1)| ... | 2^k - 1 ]
* ...
*
- * For a given integer n (> 0), the leaf-array is at 1 + floor(log2(n)).
+ * For a given integer n (> 0), the leaf-array is at 1 + floor(log2(n)).
*
* The idea for the geometrically increasing array sizes is from:
* Fast Functional Lists, Hash-Lists, Deques and Variable Length Arrays.
@@ -394,7 +394,7 @@ cint_copy(NODE *symbol, NODE *newsymb)
for (i = NHAT; i < INT32_BIT; i++) {
if (old[i] == NULL)
continue;
- new[i] = make_node(Node_array_tree);
+ new[i] = make_node(Node_array_tree);
tree_copy(newsymb, old[i], new[i]);
}
@@ -494,7 +494,7 @@ cint_dump(NODE *symbol, NODE *ndump)
xsize = xn->table_size;
}
cint_size = symbol->table_size - xsize;
-
+
if ((symbol->flags & XARRAY) == 0)
fprintf(output_fp, "%s `%s'\n",
(symbol->parent_array == NULL) ? "array" : "sub-array",
@@ -525,7 +525,7 @@ cint_dump(NODE *symbol, NODE *ndump)
/* Node_array_tree + HAT */
kb += (sizeof(NODE) + tree_kilobytes(tn)) / 1024.0;
}
- kb += (INT32_BIT * sizeof(NODE *)) / 1024.0; /* symbol->nodes */
+ kb += (INT32_BIT * sizeof(NODE *)) / 1024.0; /* symbol->nodes */
kb += (symbol->array_capacity * sizeof(NODE *)) / 1024.0; /* value nodes in Node_array_leaf(s) */
if (xn != NULL) {
if (xn->array_funcs == int_array_func)
@@ -600,12 +600,12 @@ cint_hash(long k)
* By Sean Eron Anderson
* seander@cs.stanford.edu
* Individually, the code snippets here are in the public domain
- * (unless otherwise noted) — feel free to use them however you please.
- * The aggregate collection and descriptions are © 1997-2005
+ * (unless otherwise noted) --- feel free to use them however you please.
+ * The aggregate collection and descriptions are (C) 1997-2005
* Sean Eron Anderson. The code and descriptions are distributed in the
* hope that they will be useful, but WITHOUT ANY WARRANTY and without
* even the implied warranty of merchantability or fitness for a particular
- * purpose.
+ * purpose.
*
*/
@@ -678,15 +678,15 @@ cint_print(NODE *symbol)
/*
* A half HAT is defined here as a HAT with a top-level array of size n^2/2
* and holds the first n^2/2 elements.
- *
+ *
* 1. 2^8 elements can be stored in a full HAT of size 2^4.
- * 2. 2^9 elements can be stored in a half HAT of size 2^5.
+ * 2. 2^9 elements can be stored in a half HAT of size 2^5.
* 3. When the number of elements is some power of 2, it
* can be stored in a full or a half HAT.
* 4. When the number of elements is some power of 2, it
* can be stored in a HAT (full or half) with HATs as leaf elements
* (full or half), and so on (e.g. 2^8 elements in a HAT of size 2^4 (top-level
- * array dimension) with each leaf array being a HAT of size 2^2).
+ * array dimension) with each leaf array being a HAT of size 2^2).
*
* IMPLEMENTATION DETAILS:
* 1. A HAT of 2^12 elements needs 2^6 house-keeping NODEs
@@ -737,7 +737,7 @@ tree_lookup(NODE *symbol, NODE *tree, long k, int m, long base)
*/
n = (m + 1) / 2;
-
+
if (tree->table_size == 0) {
size_t actual_size;
NODE **table;
@@ -920,7 +920,7 @@ tree_list(NODE *tree, NODE **list, assoc_kind_t assoc_kind)
static void
tree_copy(NODE *newsymb, NODE *tree, NODE *newtree)
-{
+{
NODE **old, **new;
size_t j, hsize;
@@ -1061,13 +1061,13 @@ leaf_lookup(NODE *symbol, NODE *array, long k, long size, long base)
}
-/* leaf_exists --- check if the array contains an integer subscript */
+/* leaf_exists --- check if the array contains an integer subscript */
static inline NODE **
leaf_exists(NODE *array, long k)
{
NODE **lhs;
- lhs = array->nodes + (k - array->array_base);
+ lhs = array->nodes + (k - array->array_base);
return (*lhs != NULL) ? lhs : NULL;
}
@@ -1086,7 +1086,7 @@ leaf_clear(NODE *array)
continue;
if (r->type == Node_var_array) {
assoc_clear(r); /* recursively clear all sub-arrays */
- efree(r->vname);
+ efree(r->vname);
freenode(r);
} else
unref(r);
@@ -1104,7 +1104,7 @@ leaf_remove(NODE *symbol, NODE *array, long k)
{
NODE **lhs;
- lhs = array->nodes + (k - array->array_base);
+ lhs = array->nodes + (k - array->array_base);
if (*lhs == NULL)
return false;
*lhs = NULL;
@@ -1171,7 +1171,7 @@ leaf_list(NODE *array, NODE **list, assoc_kind_t assoc_kind)
/* index */
num = array->array_base + ci;
if ((assoc_kind & AISTR) != 0) {
- sprintf(buf, "%ld", num);
+ sprintf(buf, "%ld", num);
subs = make_string(buf, strlen(buf));
subs->numbr = num;
subs->flags |= (NUMCUR|NUMINT);
diff --git a/cmd.h b/cmd.h
index 11844157..4313a6fd 100644
--- a/cmd.h
+++ b/cmd.h
@@ -2,22 +2,22 @@
* cmd.h - definitions for command parser
*/
-/*
+/*
* Copyright (C) 2004, 2010, 2011, 2013, 2014 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -106,7 +106,7 @@ enum argtype {
D_range
};
-/* non-number arguments to commands */
+/* non-number arguments to commands */
enum nametypeval {
A_NONE = 0,
@@ -135,7 +135,7 @@ typedef struct cmd_argument {
NODE *nodeval;
} value;
-#define a_int value.lval /* type = D_int or D_range */
+#define a_int value.lval /* type = D_int or D_range */
#define a_argument value.lval /* type = D_argument */
#define a_string value.sval /* type = D_string, D_array, D_subscript or D_variable */
#define a_node value.nodeval /* type = D_node, D_field or D_func */
diff --git a/command.c b/command.c
index 8c840b40..a0469bb8 100644
--- a/command.c
+++ b/command.c
@@ -89,7 +89,7 @@ static bool want_nodeval = false;
static int cmd_idx = -1; /* index of current command in cmd table */
static int repeat_idx = -1; /* index of last repeatable command in command table */
-static CMDARG *arg_list = NULL; /* list of arguments */
+static CMDARG *arg_list = NULL; /* list of arguments */
static long errcount = 0;
static char *lexptr_begin = NULL;
static bool in_commands = false;
@@ -97,7 +97,7 @@ static int num_dim;
static bool in_eval = false;
static const char start_EVAL[] = "function @eval(){";
-static const char end_EVAL[] = "}";
+static const char end_EVAL[] = "}";
static CMDARG *append_statement(CMDARG *stmt_list, char *stmt);
static NODE *concat_args(CMDARG *a, int count);
@@ -1553,7 +1553,7 @@ yyreduce:
bool terminate = false;
CMDARG *args;
int ctype = 0;
-
+
ctype = cmdtab[cmd_idx].type;
/* a blank line repeats previous command
@@ -1794,7 +1794,7 @@ yyreduce:
if (type) {
in_commands = true;
if (input_from_tty) {
- dbg_prompt = commands_prompt;
+ dbg_prompt = commands_prompt;
fprintf(out_fp, _("Type commands for when %s %d is hit, one per line.\n"),
(type == D_break) ? "breakpoint" : "watchpoint", num);
fprintf(out_fp, _("End with the command \"end\"\n"));
@@ -1811,7 +1811,7 @@ yyreduce:
yyerror(_("`end' valid only in command `commands' or `eval'"));
else {
if (input_from_tty)
- dbg_prompt = dgawk_prompt;
+ dbg_prompt = dgawk_prompt;
in_commands = false;
}
}
@@ -2108,7 +2108,7 @@ yyreduce:
CMDARG *a;
NODE *subs;
int count = 0;
-
+
for (a = (yyvsp[-1]); a != NULL; a = a->next)
count++;
subs = concat_args((yyvsp[-1]), count);
@@ -2165,7 +2165,7 @@ yyreduce:
case 145:
#line 678 "command.y" /* yacc.c:1646 */
- {
+ {
NODE *n = (yyvsp[0])->a_node;
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
@@ -2176,7 +2176,7 @@ yyreduce:
case 146:
#line 685 "command.y" /* yacc.c:1646 */
- {
+ {
NODE *n = (yyvsp[0])->a_node;
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
@@ -2498,12 +2498,12 @@ yyreturn:
-/* append_statement --- append 'stmt' to the list of eval awk statements */
+/* append_statement --- append 'stmt' to the list of eval awk statements */
static CMDARG *
-append_statement(CMDARG *stmt_list, char *stmt)
+append_statement(CMDARG *stmt_list, char *stmt)
{
- CMDARG *a, *arg;
+ CMDARG *a, *arg;
char *s;
int len, slen, ssize;
@@ -2535,7 +2535,7 @@ append_statement(CMDARG *stmt_list, char *stmt)
s[slen] = '\0';
return arg;
}
-
+
len = strlen(stmt) + 1; /* 1 for newline */
s = stmt_list->a_string;
slen = strlen(s);
@@ -2699,7 +2699,7 @@ get_command_name(int ctype)
return cmdtab[i].name;
}
return NULL;
-}
+}
/* mk_cmdarg --- make an argument for command */
@@ -2714,7 +2714,7 @@ mk_cmdarg(enum argtype type)
}
/* append_cmdarg --- append ARG to the list of arguments for the current command */
-
+
static void
append_cmdarg(CMDARG *arg)
{
@@ -2785,7 +2785,7 @@ yylex(void)
static char *lexend;
int c;
char *tokstart;
- size_t toklen;
+ size_t toklen;
yylval = (CMDARG *) NULL;
@@ -2799,7 +2799,7 @@ yylex(void)
again:
lexptr_begin = read_a_line(dbg_prompt);
if (lexptr_begin == NULL) { /* EOF or error */
- if (get_eof_status() == EXIT_FATAL)
+ if (get_eof_status() == EXIT_FATAL)
exit(EXIT_FATAL);
if (get_eof_status() == EXIT_FAILURE) {
static int seen_eof = 0;
@@ -2831,7 +2831,7 @@ again:
&& input_from_tty
)
history_expand_line(&lexptr_begin);
-
+
lexptr = lexptr_begin;
lexend = lexptr + strlen(lexptr);
if (*lexptr == '\0' /* blank line */
@@ -2850,14 +2850,14 @@ again:
}
repeat_idx = -1;
}
-
+
c = *lexptr;
while (c == ' ' || c == '\t')
c = *++lexptr;
if (! input_from_tty && c == '#')
- return '\n';
+ return '\n';
tokstart = lexptr;
if (lexptr >= lexend)
@@ -2914,7 +2914,7 @@ again:
}
c = *lexptr;
-
+
if (cmdtab[cmd_idx].type == D_option) {
if (c == '=')
return *lexptr++;
@@ -3016,8 +3016,8 @@ err:
r = mpg_integer();
mpfr_get_z(r->mpg_i, tmp->mpg_numbr, MPFR_RNDZ);
unref(tmp);
- }
- } else
+ }
+ } else
#endif
r = make_number(strtod(tokstart, & lexptr));
@@ -3126,7 +3126,7 @@ concat_args(CMDARG *arg, int count)
n = force_string(arg->a_node);
return dupnode(n);
}
-
+
emalloc(tmp, NODE **, count * sizeof(NODE *), "concat_args");
subseplen = SUBSEP_node->var_value->stlen;
subsep = SUBSEP_node->var_value->stptr;
@@ -3161,7 +3161,7 @@ concat_args(CMDARG *arg, int count)
}
/* find_command --- find the index in 'cmdtab' using exact,
- * abbreviation or unique partial match
+ * abbreviation or unique partial match
*/
static int
@@ -3253,10 +3253,10 @@ do_help(CMDARG *arg, int cmd)
#ifdef HAVE_LIBREADLINE
-/* next_word --- find the next word in a line to complete
+/* next_word --- find the next word in a line to complete
* (word seperation characters are space and tab).
*/
-
+
static char *
next_word(char *p, int len, char **endp)
{
@@ -3338,10 +3338,10 @@ command_completion(const char *text, int start, int end)
if (this_cmd == D_print || this_cmd == D_printf)
return rl_completion_matches(text, variable_generator);
return NULL;
-}
+}
/* command_generator --- generator function for command completion */
-
+
static char *
command_generator(const char *text, int state)
{
@@ -3414,7 +3414,7 @@ argument_generator(const char *text, int state)
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
- }
+ }
return NULL;
}
diff --git a/command.y b/command.y
index 42fa40fa..4597dba1 100644
--- a/command.y
+++ b/command.y
@@ -2,23 +2,23 @@
* command.y - yacc/bison parser for debugger commands.
*/
-/*
+/*
* Copyright (C) 2004, 2010, 2011, 2014, 2016
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
@@ -42,7 +42,7 @@ static bool want_nodeval = false;
static int cmd_idx = -1; /* index of current command in cmd table */
static int repeat_idx = -1; /* index of last repeatable command in command table */
-static CMDARG *arg_list = NULL; /* list of arguments */
+static CMDARG *arg_list = NULL; /* list of arguments */
static long errcount = 0;
static char *lexptr_begin = NULL;
static bool in_commands = false;
@@ -50,7 +50,7 @@ static int num_dim;
static bool in_eval = false;
static const char start_EVAL[] = "function @eval(){";
-static const char end_EVAL[] = "}";
+static const char end_EVAL[] = "}";
static CMDARG *append_statement(CMDARG *stmt_list, char *stmt);
static NODE *concat_args(CMDARG *a, int count);
@@ -132,7 +132,7 @@ line
bool terminate = false;
CMDARG *args;
int ctype = 0;
-
+
ctype = cmdtab[cmd_idx].type;
/* a blank line repeats previous command
@@ -308,7 +308,7 @@ command
| D_LIST list_args
| D_UNTIL location
| D_CLEAR location
- | break_cmd break_args
+ | break_cmd break_args
| D_SET { want_nodeval = true; } variable '=' node
| D_OPTION option_args
| D_RETURN { want_nodeval = true; } opt_node
@@ -345,7 +345,7 @@ command
if (type) {
in_commands = true;
if (input_from_tty) {
- dbg_prompt = commands_prompt;
+ dbg_prompt = commands_prompt;
fprintf(out_fp, _("Type commands for when %s %d is hit, one per line.\n"),
(type == D_break) ? "breakpoint" : "watchpoint", num);
fprintf(out_fp, _("End with the command \"end\"\n"));
@@ -358,7 +358,7 @@ command
yyerror(_("`end' valid only in command `commands' or `eval'"));
else {
if (input_from_tty)
- dbg_prompt = dgawk_prompt;
+ dbg_prompt = dgawk_prompt;
in_commands = false;
}
}
@@ -493,9 +493,9 @@ location
break_args
: /* empty */
- { $$ = NULL; }
+ { $$ = NULL; }
| plus_integer { want_nodeval = true; } condition_exp
- | func_name
+ | func_name
| D_STRING ':' plus_integer { want_nodeval = true; } condition_exp
| D_STRING ':' func_name
;
@@ -631,7 +631,7 @@ subscript
CMDARG *a;
NODE *subs;
int count = 0;
-
+
for (a = $2; a != NULL; a = a->next)
count++;
subs = concat_args($2, count);
@@ -641,7 +641,7 @@ subscript
$2->a_node = subs;
$$ = $2;
}
- | '[' exp_list error
+ | '[' exp_list error
;
subscript_list
@@ -675,14 +675,14 @@ node
: D_NODE
{ $$ = $1; }
| '+' D_NODE
- {
+ {
NODE *n = $2->a_node;
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
$$ = $2;
}
| '-' D_NODE
- {
+ {
NODE *n = $2->a_node;
if ((n->flags & NUMBER) == 0)
yyerror(_("non-numeric value found, numeric expected"));
@@ -705,7 +705,7 @@ opt_integer
| integer
{ $$ = $1; }
;
-
+
plus_integer
: D_INT
{
@@ -720,7 +720,7 @@ plus_integer
$$ = $2;
}
;
-
+
integer
: D_INT
{ $$ = $1; }
@@ -748,12 +748,12 @@ nls
%%
-/* append_statement --- append 'stmt' to the list of eval awk statements */
+/* append_statement --- append 'stmt' to the list of eval awk statements */
static CMDARG *
-append_statement(CMDARG *stmt_list, char *stmt)
+append_statement(CMDARG *stmt_list, char *stmt)
{
- CMDARG *a, *arg;
+ CMDARG *a, *arg;
char *s;
int len, slen, ssize;
@@ -785,7 +785,7 @@ append_statement(CMDARG *stmt_list, char *stmt)
s[slen] = '\0';
return arg;
}
-
+
len = strlen(stmt) + 1; /* 1 for newline */
s = stmt_list->a_string;
slen = strlen(s);
@@ -949,7 +949,7 @@ get_command_name(int ctype)
return cmdtab[i].name;
}
return NULL;
-}
+}
/* mk_cmdarg --- make an argument for command */
@@ -964,7 +964,7 @@ mk_cmdarg(enum argtype type)
}
/* append_cmdarg --- append ARG to the list of arguments for the current command */
-
+
static void
append_cmdarg(CMDARG *arg)
{
@@ -1035,7 +1035,7 @@ yylex(void)
static char *lexend;
int c;
char *tokstart;
- size_t toklen;
+ size_t toklen;
yylval = (CMDARG *) NULL;
@@ -1049,7 +1049,7 @@ yylex(void)
again:
lexptr_begin = read_a_line(dbg_prompt);
if (lexptr_begin == NULL) { /* EOF or error */
- if (get_eof_status() == EXIT_FATAL)
+ if (get_eof_status() == EXIT_FATAL)
exit(EXIT_FATAL);
if (get_eof_status() == EXIT_FAILURE) {
static int seen_eof = 0;
@@ -1081,7 +1081,7 @@ again:
&& input_from_tty
)
history_expand_line(&lexptr_begin);
-
+
lexptr = lexptr_begin;
lexend = lexptr + strlen(lexptr);
if (*lexptr == '\0' /* blank line */
@@ -1100,14 +1100,14 @@ again:
}
repeat_idx = -1;
}
-
+
c = *lexptr;
while (c == ' ' || c == '\t')
c = *++lexptr;
if (! input_from_tty && c == '#')
- return '\n';
+ return '\n';
tokstart = lexptr;
if (lexptr >= lexend)
@@ -1164,7 +1164,7 @@ again:
}
c = *lexptr;
-
+
if (cmdtab[cmd_idx].type == D_option) {
if (c == '=')
return *lexptr++;
@@ -1266,8 +1266,8 @@ err:
r = mpg_integer();
mpfr_get_z(r->mpg_i, tmp->mpg_numbr, MPFR_RNDZ);
unref(tmp);
- }
- } else
+ }
+ } else
#endif
r = make_number(strtod(tokstart, & lexptr));
@@ -1376,7 +1376,7 @@ concat_args(CMDARG *arg, int count)
n = force_string(arg->a_node);
return dupnode(n);
}
-
+
emalloc(tmp, NODE **, count * sizeof(NODE *), "concat_args");
subseplen = SUBSEP_node->var_value->stlen;
subsep = SUBSEP_node->var_value->stptr;
@@ -1411,7 +1411,7 @@ concat_args(CMDARG *arg, int count)
}
/* find_command --- find the index in 'cmdtab' using exact,
- * abbreviation or unique partial match
+ * abbreviation or unique partial match
*/
static int
@@ -1503,10 +1503,10 @@ do_help(CMDARG *arg, int cmd)
#ifdef HAVE_LIBREADLINE
-/* next_word --- find the next word in a line to complete
+/* next_word --- find the next word in a line to complete
* (word seperation characters are space and tab).
*/
-
+
static char *
next_word(char *p, int len, char **endp)
{
@@ -1588,10 +1588,10 @@ command_completion(const char *text, int start, int end)
if (this_cmd == D_print || this_cmd == D_printf)
return rl_completion_matches(text, variable_generator);
return NULL;
-}
+}
/* command_generator --- generator function for command completion */
-
+
static char *
command_generator(const char *text, int state)
{
@@ -1664,7 +1664,7 @@ argument_generator(const char *text, int state)
if (strncmp(name, text, textlen) == 0)
return estrdup(name, strlen(name));
}
- }
+ }
return NULL;
}
diff --git a/custom.h b/custom.h
index aa76931b..90fd1f63 100644
--- a/custom.h
+++ b/custom.h
@@ -10,23 +10,23 @@
* the information, to arnold@skeeve.com.
*/
-/*
+/*
* Copyright (C) 1995-2004, 2008, 2009, 2011, 2016
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/debug.c b/debug.c
index 9793c3ec..70ba82e2 100644
--- a/debug.c
+++ b/debug.c
@@ -1,23 +1,23 @@
/*
- * debug.c - gawk debugger
+ * debug.c - gawk debugger
*/
-/*
+/*
* Copyright (C) 2004, 2010-2013, 2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -77,7 +77,7 @@ struct commands_item {
CMDARG *arg;
};
-/* breakpoint structure */
+/* breakpoint structure */
typedef struct break_point {
struct break_point *next;
struct break_point *prev;
@@ -99,7 +99,7 @@ typedef struct break_point {
#define BP_TEMP 4
#define BP_IGNORE 8
-} BREAKPOINT;
+} BREAKPOINT;
static BREAKPOINT breakpoints = { &breakpoints, &breakpoints, 0 };
@@ -126,12 +126,12 @@ struct list_item {
NODE *symbol; /* variable or function param */
NODE **subs; /* subscripts */
- int num_subs; /* subscript(dimension) count */
+ int num_subs; /* subscript(dimension) count */
char *sname; /* symbol or param name */
long fcall_count;
- struct commands_item commands;
+ struct commands_item commands;
int silent;
struct condition cndn;
@@ -149,8 +149,8 @@ struct list_item {
#define PARAM 1
#define SUBSCRIPT 2
#define FIELD_NUM 4
-#define OLD_IS_ARRAY 8 /* old item is array */
-#define CUR_IS_ARRAY 16 /* current item is array */
+#define OLD_IS_ARRAY 8 /* old item is array */
+#define CUR_IS_ARRAY 16 /* current item is array */
};
#define IS_PARAM(d) (((d)->flags & PARAM) != 0)
@@ -175,7 +175,7 @@ static struct {
INSTRUCTION *pc; /* 'until' and 'return' commands */
int repeat_count; /* 'step', 'next', 'stepi', 'nexti' commands */
bool print_frame; /* print frame info, 'finish' and 'until' */
- bool print_ret; /* print returned value, 'finish' */
+ bool print_ret; /* print returned value, 'finish' */
int break_point; /* non-zero (breakpoint number) if stopped at break point */
int watch_point; /* non-zero (watchpoint number) if stopped at watch point */
@@ -183,7 +183,7 @@ static struct {
* awk interpreter and return control
* to debugger command interpreter.
*/
-
+
enum argtype command; /* command type */
} stop;
@@ -216,7 +216,7 @@ struct dbg_option {
int *num_val;
char **str_val;
void (*assign)(const char *);
- const char *help_txt;
+ const char *help_txt;
};
#define DEFAULT_HISTFILE "./.gawk_history"
@@ -273,7 +273,7 @@ jmp_buf pager_quit_tag;
bool pager_quit_tag_valid = false;
static int screen_width = INT_MAX; /* no of columns */
static int screen_height = INT_MAX; /* no of rows */
-static int pager_lines_printed = 0; /* no of lines printed so far */
+static int pager_lines_printed = 0; /* no of lines printed so far */
static void restart(bool run) ATTRIBUTE_NORETURN;
static void close_all(void);
@@ -574,7 +574,7 @@ print_lines(char *src, int start_line, int nlines)
for (i = start_line; i < start_line + nlines; i++) {
int supposed_len, len;
char *p;
-
+
sprintf(linebuf, "%-8d", i);
/* mark the line about to be executed with =>; nlines > 1
@@ -582,7 +582,7 @@ print_lines(char *src, int start_line, int nlines)
*/
if (nlines > 1) {
BREAKPOINT *b;
- bool has_bpt = false;
+ bool has_bpt = false;
for (b = breakpoints.prev; b != &breakpoints; b = b->prev) {
if (src == b->src && i == b->bpi->source_line) {
has_bpt = true;
@@ -595,7 +595,7 @@ print_lines(char *src, int start_line, int nlines)
else
sprintf(linebuf, "%-4d =>", i);
} else if (has_bpt)
- sprintf(linebuf, "%-4d:b ", i);
+ sprintf(linebuf, "%-4d:b ", i);
}
p = linebuf + strlen(linebuf);
@@ -647,7 +647,7 @@ do_list(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
long count = list_size;
INSTRUCTION *rp;
char *src = cur_srcfile->src;
-
+
line_first = last_printed_line + 1; /* default or no arg */
if (arg == NULL) /* list or list + */
goto list;
@@ -679,10 +679,10 @@ range:
count = arg->a_int - line_first + 1;
break;
- case D_string:
+ case D_string:
src = arg->a_string;
if (arg->next != NULL) {
- arg = arg->next;
+ arg = arg->next;
if (arg->type == D_int) /* list file:n */
goto line;
else if (arg->type == D_range) /* list file:m-n */
@@ -713,7 +713,7 @@ list:
if (line_last != -1) {
last_printed_line = line_last;
last_print_count = line_last - line_first + 1;
- }
+ }
return false;
}
@@ -780,7 +780,7 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
continue;
start++;
*end = '\0';
- gprintf(out_fp, "%s", start); /* FIXME: translate ? */
+ gprintf(out_fp, "%s", start); /* FIXME: translate ? */
*end = '}';
}
}
@@ -900,7 +900,7 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
sub = d->subs[i];
gprintf(out_fp, "[\"%s\"]", sub->stptr);
}
- gprintf(out_fp, "\n");
+ gprintf(out_fp, "\n");
} else if (IS_FIELD(d))
gprintf(out_fp, "%d:\t$%ld\n", d->number, get_number_si(symbol));
else
@@ -920,7 +920,7 @@ do_info(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
continue;
start++;
*end = '\0';
- gprintf(out_fp, "%s", start); /* FIXME: translate ? */
+ gprintf(out_fp, "%s", start); /* FIXME: translate ? */
*end = '}';
}
}
@@ -998,7 +998,7 @@ find_param(const char *name, long num, char **pname)
func = f->func_node;
pcount = func->param_cnt;
for (i = 0; i < pcount; i++) {
- fparam = func->fparms[i].param;
+ fparam = func->fparms[i].param;
if (strcmp(name, fparam) == 0) {
r = f->stack[i];
if (r->type == Node_array_ref)
@@ -1123,7 +1123,7 @@ print_subscript(NODE *arr, char *arr_name, CMDARG *a, int count)
else {
/* print # of elements in array */
fprintf(out_fp, "%s = ", r->vname);
- print_symbol(r, false);
+ print_symbol(r, false);
}
} else {
fprintf(out_fp, "%s[\"%s\"] = ", arr_name, subs->stptr);
@@ -1163,7 +1163,7 @@ do_print_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if ((r = find_array(name)) != NULL) {
int count = a->a_count;
for (; count > 0; count--) {
- NODE *value, *subs;
+ NODE *value, *subs;
a = a->next;
subs = a->a_node;
value = in_array(r, subs);
@@ -1195,9 +1195,9 @@ do_print_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
/* notably D_node, subscript for invalid array name; skip */
break;
}
- }
+ }
return false;
-}
+}
/* do_set_var --- set command */
@@ -1358,7 +1358,7 @@ delete_item(struct list_item *d)
free_context(d->cndn.ctxt, false);
if (d->cndn.expr != NULL)
efree(d->cndn.expr);
-
+
d->next->prev = d->prev;
d->prev->next = d->next;
efree(d);
@@ -1533,7 +1533,7 @@ display(struct list_item *d)
symbol = r;
if (i == count - 1) /* it's a sub-array */
goto print_sym; /* print # of elements in sub-array */
- } else {
+ } else {
if (i != count - 1)
return; /* FIXME msg and delete item ? */
fprintf(out_fp, "%d: %s[\"%s\"] = ", d->number,
@@ -1574,15 +1574,15 @@ do_display(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
/* do_undisplay --- undisplay command */
-
+
int
do_undisplay(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
do_delete_item(&display_list, arg);
- return false;
+ return false;
}
-/* condition_triggered --- test if a condition expression is true */
+/* condition_triggered --- test if a condition expression is true */
static int
condition_triggered(struct condition *cndn)
@@ -1631,21 +1631,21 @@ find_subscript(struct list_item *item, NODE **ptr)
}
/* cmp_val --- compare values of watched item, returns true if different; */
-
+
static int
-cmp_val(struct list_item *w, NODE *old, NODE *new)
+cmp_val(struct list_item *w, NODE *old, NODE *new)
{
/*
* case old new result
* ------------------------------
- * 1: NULL ARRAY true
+ * 1: NULL ARRAY true
* 2: NULL SCALAR true
* 3: NULL NULL false
* 4: SCALAR SCALAR cmp_node
* 5: SCALAR ARRAY true
* 6: SCALAR NULL true
* 7: ARRAY SCALAR true
- * 8: ARRAY ARRAY compare size
+ * 8: ARRAY ARRAY compare size
* 9: ARRAY NULL true
*/
@@ -1839,7 +1839,7 @@ do_watch(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
/* do_unwatch --- unwatch command */
-
+
int
do_unwatch(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
@@ -1886,9 +1886,9 @@ print_function(INSTRUCTION *pc, void *x)
{
NODE *func;
int i, pcount;
- struct pf_data *data = (struct pf_data *) x;
+ struct pf_data *data = (struct pf_data *) x;
int defn = data->defn;
- Func_print print_func = data->print_func;
+ Func_print print_func = data->print_func;
FILE *fp = data->fp;
func = pc->func_body;
@@ -1897,7 +1897,7 @@ print_function(INSTRUCTION *pc, void *x)
print_func(fp, "%s(", func->vname);
for (i = 0; i < pcount; i++) {
print_func(fp, "%s", func->fparms[i].param);
- if (i < pcount - 1)
+ if (i < pcount - 1)
print_func(fp, ", ");
}
print_func(fp, ")");
@@ -1941,7 +1941,7 @@ print_numbered_frame(long num)
} else {
fprintf(out_fp, _("#%ld\tin "), num);
print_frame(f->func_node, f->vname,
- ((INSTRUCTION *) find_frame(num - 1)->reti)->source_line);
+ ((INSTRUCTION *) find_frame(num - 1)->reti)->source_line);
}
fprintf(out_fp, "\n");
}
@@ -1970,7 +1970,7 @@ do_backtrace(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (cur < 0)
cur = 0;
}
- }
+ }
for (; cur <= last; cur++) {
print_numbered_frame(cur);
@@ -1978,12 +1978,12 @@ do_backtrace(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (cur <= fcall_count)
fprintf(out_fp, _("More stack frames follow ...\n"));
return false;
-}
+}
/* print_cur_frame_and_sourceline --- print current frame, and
* current source line.
*/
-
+
static void
print_cur_frame_and_sourceline()
{
@@ -2097,7 +2097,7 @@ find_rule(char *src, long lineno)
/* mk_breakpoint --- create a breakpoint instruction and the corresponding
* breakpoint structure.
*/
-
+
static INSTRUCTION *
mk_breakpoint(char *src, int srcline)
{
@@ -2118,7 +2118,7 @@ mk_breakpoint(char *src, int srcline)
b->src = src;
bp->break_pt = b;
b->bpi = bp;
-
+
/* prepend to list */
b->next = breakpoints.next;
b->prev = &breakpoints;
@@ -2141,7 +2141,7 @@ delete_breakpoint(BREAKPOINT *b)
* deleteing the instruction is not that simple,
* since could have reference to it somewhere else (e.g. cur_pc).
*/
-
+
pc->opcode = Op_no_op;
pc->source_line = 0;
pc->break_pt = NULL;
@@ -2152,7 +2152,7 @@ delete_breakpoint(BREAKPOINT *b)
delete_commands_item(c->next);
}
- free_context(b->cndn.ctxt, false);
+ free_context(b->cndn.ctxt, false);
if (b->cndn.expr != NULL)
efree(b->cndn.expr);
@@ -2170,7 +2170,7 @@ find_breakpoint(long num)
BREAKPOINT *b;
if (num <= 0)
- return NULL;
+ return NULL;
for (b = breakpoints.next; b != &breakpoints; b = b->next) {
if (b->number == num)
@@ -2180,7 +2180,7 @@ find_breakpoint(long num)
}
/* add_breakpoint --- add a breakpoint instruction between PREVP and IP */
-
+
static BREAKPOINT *
add_breakpoint(INSTRUCTION *prevp, INSTRUCTION *ip, char *src, bool silent)
{
@@ -2260,7 +2260,7 @@ set_breakpoint_at(INSTRUCTION *rp, int lineno, bool silent)
* a monotonically increasing sequence. Check if the line # is between
* the first and last statements of the case block before continuing
* the search.
- */
+ */
for (i2 = ip->stmt_start, i1 = i2->nexti; i2 != ip->stmt_end;
i2 = i1, i1 = i1->nexti) {
if (i1->source_line >= lineno)
@@ -2298,7 +2298,7 @@ set_breakpoint_next(INSTRUCTION *rp, INSTRUCTION *ip)
}
return NULL;
}
-
+
/* set_breakpoint --- set a breakpoint */
static int
@@ -2314,7 +2314,7 @@ set_breakpoint(CMDARG *arg, bool temporary)
if (arg == NULL) {
/*
* (From GDB Documentation):
-*
+*
* When called without any arguments, break sets a breakpoint at the next instruction
* to be executed in the selected stack frame (see section Examining the Stack).
* In any selected frame but the innermost, this makes your program stop as soon
@@ -2327,7 +2327,7 @@ set_breakpoint(CMDARG *arg, bool temporary)
* one instruction has been executed. If it did not do this,
* you would be unable to proceed past a breakpoint without first disabling the
* breakpoint. This rule applies whether or not the breakpoint already existed
-* when your program stopped.
+* when your program stopped.
*/
CHECK_PROG_RUNNING();
if (cur_frame == 0) {
@@ -2432,7 +2432,7 @@ breakpoint_triggered(BREAKPOINT *b)
if ((b->flags & BP_ENABLE_ONCE) != 0) {
b->flags &= ~BP_ENABLE_ONCE;
b->flags &= ~BP_ENABLE;
- }
+ }
return b->number;
}
@@ -2442,7 +2442,7 @@ int
do_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
return set_breakpoint(arg, false);
-}
+}
/* do_tmp_breakpoint --- tbreak command */
@@ -2616,7 +2616,7 @@ do_delete_breakpoint(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
delete_all = prompt_yes_no(
_("Delete all breakpoints? (y or n) "),
_("y")[0], true, out_fp);
-
+
if (delete_all) {
while (breakpoints.next != &breakpoints)
delete_breakpoint(breakpoints.next);
@@ -2741,7 +2741,7 @@ initialize_readline()
/* our completion function. */
rl_attempted_completion_function = command_completion;
- read_a_line = readline;
+ read_a_line = readline;
}
#else
#define initialize_readline() /* nothing */
@@ -2774,9 +2774,9 @@ debug_prog(INSTRUCTION *pc)
if (! read_a_line)
read_a_line = g_readline;
- push_cmd_src(input_fd, input_from_tty, read_a_line, 0, 0, EXIT_FATAL);
+ push_cmd_src(input_fd, input_from_tty, read_a_line, 0, 0, EXIT_FATAL);
- setbuf(out_fp, (char *) NULL);
+ setbuf(out_fp, (char *) NULL);
for (cur_srcfile = srcfiles->prev; cur_srcfile != srcfiles;
cur_srcfile = cur_srcfile->prev) {
if (cur_srcfile->stype == SRC_FILE
@@ -2805,7 +2805,7 @@ debug_prog(INSTRUCTION *pc)
unserialize(HISTORY);
unserialize(OPTION);
unsetenv("DGAWK_RESTART");
- fprintf(out_fp, "Restarting ...\n");
+ fprintf(out_fp, "Restarting ...\n");
if (strcasecmp(run, "true") == 0)
(void) do_run(NULL, 0);
@@ -2872,7 +2872,7 @@ check_breakpoint(INSTRUCTION **pi)
pc = *pi;
if (stop.command == D_return)
- return false;
+ return false;
if (pc->opcode == Op_breakpoint) {
int bnum;
*pi = pc->nexti; /* skip past the breakpoint instruction;
@@ -3244,7 +3244,7 @@ check_return(INSTRUCTION **pi)
func = find_frame(cur_frame)->func_node;
assert(func != NULL);
- *pi = (func->code_ptr + 1)->lasti;
+ *pi = (func->code_ptr + 1)->lasti;
/* assert((*pi)->opcode == Op_K_return); */
}
@@ -3311,7 +3311,7 @@ do_until(CMDARG *arg, int cmd)
int lineno;
INSTRUCTION *rp, *ip;
NODE *func;
-
+
CHECK_PROG_RUNNING();
stop.pc = NULL;
stop.sourceline = 0;
@@ -3418,7 +3418,7 @@ print_watch_item(struct list_item *w)
sub = w->subs[i];
fprintf(out_fp, "[\"%s\"]", sub->stptr);
}
- fprintf(out_fp, "\n");
+ fprintf(out_fp, "\n");
} else if (IS_FIELD(w))
fprintf(out_fp, "$%ld\n", get_number_si(symbol));
else
@@ -3483,12 +3483,12 @@ next_command()
print_watch_item(w);
}
- /* frame info */
+ /* frame info */
if (stop.print_frame) {
print_frame(frame_ptr->func_node, source, sourceline);
fprintf(out_fp, "\n");
stop.print_frame = false;
- }
+ }
(void) print_lines(source, sourceline, 1);
@@ -3500,12 +3500,12 @@ no_output:
/* update last_printed_line, so that output of 'list' is
* centered around current sourceline
*/
-
+
last_printed_line = sourceline - list_size / 2;
if (last_printed_line < 0)
last_printed_line = 0;
- /* update current source file */
+ /* update current source file */
s = source_find(source);
if (cur_srcfile != s) {
if (cur_srcfile->fd != INVALID_HANDLE) {
@@ -3531,7 +3531,7 @@ no_output:
read_command(); /* zzparse */
}
-/* debug_post_execute --- post_hook in the interpreter */
+/* debug_post_execute --- post_hook in the interpreter */
static void
debug_post_execute(INSTRUCTION *pc)
@@ -3550,14 +3550,14 @@ debug_post_execute(INSTRUCTION *pc)
stop.command = D_illegal;
stop.check_func = NULL;
fprintf(out_fp, _("'finish' not meaningful with non-local jump '%s'\n"),
- op2str(pc->opcode));
+ op2str(pc->opcode));
} else if (stop.command == D_until) {
/* cancel until command */
stop.print_frame = false;
stop.command = D_illegal;
stop.check_func = NULL;
fprintf(out_fp, _("'until' not meaningful with non-local jump '%s'\n"),
- op2str(pc->opcode));
+ op2str(pc->opcode));
}
break;
@@ -3584,7 +3584,7 @@ debug_post_execute(INSTRUCTION *pc)
}
}
-/* debug_pre_execute --- pre_hook, called by the interpreter before execution;
+/* debug_pre_execute --- pre_hook, called by the interpreter before execution;
* checks if execution needs to be suspended and control
* transferred to the debugger.
*/
@@ -3614,7 +3614,7 @@ debug_pre_execute(INSTRUCTION **pi)
* yield surprising results. Ditto for Op_push_lhs for special variables
* (upto Op_var_assign, the set_FOO routine).
*/
-
+
switch (cur_pc->opcode) {
case Op_field_spec_lhs:
cant_stop = true;
@@ -3622,7 +3622,7 @@ debug_pre_execute(INSTRUCTION **pi)
case Op_field_assign:
cant_stop = false;
- return true; /* may stop at next instruction */
+ return true; /* may stop at next instruction */
case Op_push_lhs:
m = cur_pc->memory;
@@ -3652,7 +3652,7 @@ debug_pre_execute(INSTRUCTION **pi)
break; /* processed later in check_breakpoint() */
default:
- if (cur_pc->source_line <= 0)
+ if (cur_pc->source_line <= 0)
return true;
break;
}
@@ -3690,7 +3690,7 @@ debug_pre_execute(INSTRUCTION **pi)
/* print_memory --- print a scalar value */
-static void
+static void
print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp)
{
switch (m->type) {
@@ -3722,7 +3722,7 @@ print_memory(NODE *m, NODE *func, Func_print print_func, FILE *fp)
case Node_dynregex:
break;
-
+
case Node_param_list:
assert(func != NULL);
print_func(fp, "%s", func->fparms[m->param_cnt].param);
@@ -3787,7 +3787,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
func = find_frame(0)->func_node;
}
-
+
switch (pc->opcode) {
case Op_K_if:
print_func(fp, "[branch_if = %p] [branch_else = %p] [branch_else->lasti = %p]\n",
@@ -3951,7 +3951,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
genflags2str(pc->sub_flags, values));
}
break;
-
+
case Op_builtin:
print_func(fp, "%s [arg_count = %ld]\n", getfname(pc->builtin),
pc->expr_count);
@@ -3984,7 +3984,7 @@ print_instruction(INSTRUCTION *pc, Func_print print_func, FILE *fp, int in_dump)
break;
case Op_concat:
- /* NB: concat_flag CSVAR only used in grammar, don't display it */
+ /* NB: concat_flag CSVAR only used in grammar, don't display it */
print_func(fp, "[expr_count = %ld] [concat_flag = %s]\n",
pc->expr_count,
(pc->concat_flag & CSUBSEP) != 0 ? "CSUBSEP" : "0");
@@ -4069,7 +4069,7 @@ do_trace_instruction(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
else
do_trace = false;
return false;
-}
+}
/* print_code --- print a list of instructions */
@@ -4153,7 +4153,7 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
*/
if (strlen(line) > 1
- && strncmp(line, "sa", 2) == 0)
+ && strncmp(line, "sa", 2) == 0)
continue;
fprintf(fp, "%s\n", line);
@@ -4169,9 +4169,9 @@ do_save(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
int
do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
{
- const struct dbg_option *opt;
+ const struct dbg_option *opt;
char *name, *value;
-
+
if (arg == NULL) { /* display all available options and corresponding values */
for (opt = option_list; opt->name; opt++) {
if (opt->str_val != NULL)
@@ -4206,7 +4206,7 @@ do_option(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
#ifdef HAVE_LIBREADLINE
-/* initialize_pager --- initialize our idea of the terminal size */
+/* initialize_pager --- initialize our idea of the terminal size */
void
initialize_pager(FILE *fp)
@@ -4242,9 +4242,9 @@ prompt_continue(FILE *fp)
if (quit_pager)
longjmp(pager_quit_tag, 1);
pager_lines_printed = 0;
-}
+}
-/* gprintf --- like fprintf but allows paging */
+/* gprintf --- like fprintf but allows paging */
int
gprintf(FILE *fp, const char *format, ...)
@@ -4263,9 +4263,9 @@ gprintf(FILE *fp, const char *format, ...)
} else if (buflen - bl < GPRINTF_BUFSIZ/2) {
buflen += GPRINTF_BUFSIZ;
erealloc(buf, char *, buflen * sizeof(char), "gprintf");
- }
+ }
#undef GPRINTF_BUFSIZ
-
+
while (true) {
va_start(args, format);
nchar = vsnprintf(buf + bl, buflen - bl, format, args);
@@ -4279,14 +4279,14 @@ gprintf(FILE *fp, const char *format, ...)
break;
}
- /* enlarge buffer, and try again */
+ /* enlarge buffer, and try again */
buflen *= 2;
erealloc(buf, char *, buflen * sizeof(char), "gprintf");
}
bl = 0;
for (p = buf; (q = strchr(p, '\n')) != NULL; p = q + 1) {
- int sz = (int) (q - p);
+ int sz = (int) (q - p);
while (sz > 0) {
int cnt;
@@ -4306,7 +4306,7 @@ gprintf(FILE *fp, const char *format, ...)
sz -= screen_width;
assert(sz > 0);
p += cnt;
- }
+ }
}
fprintf(fp, "\n");
@@ -4462,7 +4462,7 @@ enlarge_buffer:
else
nchar = snprintf(buf + bl, buflen - bl, "%d%c%d%c%s%c",
wd->number, FSEP, D_variable, FSEP, wd->sname, FSEP);
- cnum = wd->number;
+ cnum = wd->number;
commands = &wd->commands;
cndn = &wd->cndn;
break;
@@ -4553,8 +4553,8 @@ enlarge_buffer:
buf[bl++] = FSEP; /* field */
buf[bl++] = RSEP; /* record */
buf[bl] = '\0';
-
- /* condition expression */
+
+ /* condition expression */
if (cndn->expr) {
bl--; /* undo RSEP from above */
nchar = strlen(cndn->expr);
@@ -4582,7 +4582,7 @@ enlarge_buffer:
break;
default:
break;
- }
+ }
}
if (bl > 0) /* non-empty list */
@@ -4605,7 +4605,7 @@ unserialize_commands(char *str, int str_len)
/* unserialize_list_item --- create a list_item structure from unserialized data */
-
+
static struct list_item *
unserialize_list_item(struct list_item *list, char **pstr, int *pstr_len, int field_cnt)
{
@@ -4655,7 +4655,7 @@ unserialize_list_item(struct list_item *list, char **pstr, int *pstr_len, int fi
l->subs = subs;
}
l->number = num; /* keep same item number across executions */
-
+
if (list == &watch_list) {
initialize_watch_item(l);
/* unserialize watchpoint `commands' */
@@ -4672,11 +4672,11 @@ unserialize_list_item(struct list_item *list, char **pstr, int *pstr_len, int fi
} else
list->number = num;
- return l;
+ return l;
}
/* unserialize_breakpoint --- create a breakpoint structure from unserialized data */
-
+
static BREAKPOINT *
unserialize_breakpoint(char **pstr, int *pstr_len, int field_cnt)
{
@@ -4711,7 +4711,7 @@ unserialize_breakpoint(char **pstr, int *pstr_len, int field_cnt)
if (field_cnt > 6) /* unserialize breakpoint `commands' */
unserialize_commands(pstr[6], pstr_len[6]);
- if (field_cnt > 7) { /* condition expression */
+ if (field_cnt > 7) { /* condition expression */
char *expr;
expr = estrdup(pstr[7], pstr_len[7]);
if (parse_condition(D_break, b->number, expr) != 0)
@@ -4779,7 +4779,7 @@ unserialize(int type)
#ifdef GAWKDEBUG
fatal("Increase MAX_FIELD and recompile.\n");
#else
- return;
+ return;
#endif
}
@@ -4869,7 +4869,7 @@ has_break_or_watch_point(int *pnum, bool any)
/* N.B: breakpoints and watchpoints get numbers from a single
* counter/sequencer watch_list.number.
- */
+ */
for (b = breakpoints.next; b != &breakpoints; b = b->next) {
if (b->number == *pnum)
@@ -4904,7 +4904,7 @@ do_commands(CMDARG *arg, int cmd)
static struct list_item *w;
static struct commands_item *commands;
struct commands_item *c;
-
+
if (cmd == D_commands) {
int num = -1, type;
if (arg == NULL)
@@ -4952,7 +4952,7 @@ do_commands(CMDARG *arg, int cmd)
c->next = NULL;
c->cmd = cmd;
- /* N.B.: first arg is the command string, see command.y */
+ /* N.B.: first arg is the command string, see command.y */
c->cmd_string = arg->a_string;
c->arg = arg->next; /* actual arguments to the command */
efree(arg);
@@ -5049,7 +5049,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
d_error(_("attempt to use array `%s[\"%s\"]' in a scalar context"),
name, subs->stptr);
goto done;
- } else
+ } else
tmp[i] = value;
} else {
if (value == NULL) {
@@ -5067,7 +5067,7 @@ do_print_f(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
}
}
}
- break;
+ break;
case D_node:
tmp[i] = a->a_node;
break;
@@ -5123,7 +5123,7 @@ static int
open_readfd(const char *file)
{
int fd;
-
+
fd = open(file, O_RDONLY);
if (fd <= INVALID_HANDLE)
return INVALID_HANDLE;
@@ -5155,14 +5155,14 @@ find_option(char *name)
void
option_help()
{
- const struct dbg_option *opt;
+ const struct dbg_option *opt;
for (opt = option_list; opt->name; opt++)
fprintf(out_fp, "\t%-15.15s - %s\n", opt->name, _(opt->help_txt));
}
#ifdef HAVE_LIBREADLINE
-
+
/* option_generator --- generator function for option name completion */
char *
@@ -5224,7 +5224,7 @@ set_gawk_output(const char *file)
output_is_tty = os_isatty(fileno(stderr));
return;
}
-
+
if (strncmp(cp, "fd/", 3) == 0) {
cp += 3;
fd = (int) strtoul(cp, NULL, 10);
@@ -5242,7 +5242,7 @@ set_gawk_output(const char *file)
if (fd > INVALID_HANDLE && fp == NULL) {
fp = fdopen(fd, "w");
if (fp == NULL)
- close(fd);
+ close(fd);
}
} else {
@@ -5273,7 +5273,7 @@ set_prompt(const char *value)
dbg_prompt = dgawk_prompt;
}
-/* set_option_flag --- convert option string to flag value */
+/* set_option_flag --- convert option string to flag value */
static int
set_option_flag(const char *value)
@@ -5357,7 +5357,7 @@ read_commands_string(const char *prompt ATTRIBUTE_UNUSED)
return NULL;
p = (char *) commands_string;
- end = (char *) commands_string + commands_string_len;
+ end = (char *) commands_string + commands_string_len;
for (; p < end; p++) {
if (*p == line_sep) {
line = estrdup(commands_string, p - commands_string);
@@ -5379,7 +5379,7 @@ static void
save_options(const char *file)
{
FILE *fp;
- const struct dbg_option *opt;
+ const struct dbg_option *opt;
fp = fopen(file, "w");
if (fp == NULL)
@@ -5418,7 +5418,7 @@ close_all()
close_extensions();
- set_gawk_output(NULL); /* closes output_fp if not stdout */
+ set_gawk_output(NULL); /* closes output_fp if not stdout */
}
/* pre_execute_code --- pre_hook for execute_code, called by pre_execute */
@@ -5468,7 +5468,7 @@ execute_code(volatile INSTRUCTION *code)
/* We use one global stack for all contexts.
* Save # of items in stack; in case of
* a fatal error, pop stack until it has that many items.
- */
+ */
save_stack_size = (stack_ptr - stack_bottom) + 1;
do_flags = false;
@@ -5504,13 +5504,13 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
int ret;
int save_flags = do_flags;
SRCFILE *the_source;
-
+
if (prog_running) {
this_frame = find_frame(0);
this_func = this_frame->func_node;
}
- install_params(this_func); /* expose current function parameters to eval */
+ install_params(this_func); /* expose current function parameters to eval */
ctxt = new_context();
ctxt->install_func = append_symbol; /* keep track of newly installed globals */
push_context(ctxt);
@@ -5535,9 +5535,9 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
eval->func_name = NULL; /* not needed, func_body already assigned */
(eval + 1)->expr_count = 0;
eval->nexti = bcalloc(Op_stop, 1, 0);
-
+
} else {
- /* execute as a part of the current function */
+ /* execute as a part of the current function */
int i;
INSTRUCTION *t;
@@ -5550,7 +5550,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
/* add or append eval locals to the current frame stack */
ecount = f->param_cnt; /* eval local count */
pcount = this_func->param_cnt;
-
+
if (ecount > 0) {
if (pcount == 0)
emalloc(this_frame->stack, NODE **, ecount * sizeof(NODE *), "do_eval");
@@ -5590,7 +5590,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
/* else
fatal error */
- if (this_func != NULL && ecount > 0) {
+ if (this_func != NULL && ecount > 0) {
int i;
/* undo frame manipulation from above */
@@ -5645,7 +5645,7 @@ GDB Documentation:
immediately for syntactic correctness, and to determine whether symbols
in it have referents in the context of your breakpoint. If expression
uses symbols not referenced in the context of the breakpoint, GDB prints
-an error message:
+an error message:
No symbol "foo" in current context.
*/
@@ -5681,7 +5681,7 @@ parse_condition(int type, int num, char *expr)
cndn = &b->cndn;
rp = find_rule(b->src, b->bpi->source_line);
if (rp != NULL && rp->opcode == Op_func)
- this_func = rp->func_body;
+ this_func = rp->func_body;
} else if (type == D_watch && (w = find_item(&watch_list, num)) != NULL) {
cndn = &w->cndn;
this_func = find_frame(cur_frame)->func_node;
@@ -5701,7 +5701,7 @@ parse_condition(int type, int num, char *expr)
do_flags = false;
ret = parse_program(&code);
do_flags = save_flags;
- remove_params(this_func);
+ remove_params(this_func);
pop_context();
if (ret != 0 || invalid_symbol) {
@@ -5710,7 +5710,7 @@ parse_condition(int type, int num, char *expr)
}
/* condition expression is parsed as awk pattern without
- * any action. The code is then modified to end up with
+ * any action. The code is then modified to end up with
* a `1.0' on stack when the expression is true, `0.0' otherwise.
*/
@@ -5725,7 +5725,7 @@ parse_condition(int type, int num, char *expr)
it->nexti = bcalloc(Op_jmp, 1, 0);
it->nexti->target_jmp = stop;
it->nexti->nexti = rule->lasti;
-
+
it = rule->lasti; /* Op_no_op, target for Op_jmp_false */
assert(it->opcode == Op_no_op);
it->opcode = Op_push_i;
@@ -5803,13 +5803,13 @@ push_cmd_src(
/* eof_status = EXIT_FATAL - exit with status EXIT_FATAL on EOF or error.
* = EXIT_FAILURE - exit status EXIT_FAILURE on error.
- * = EXIT_SUCCESS - don't exit on EOF or error.
+ * = EXIT_SUCCESS - don't exit on EOF or error.
*/
cs->eof_status = eofstatus;
cs->str = NULL;
cs->next = cmd_src;
cmd_src = cs;
-
+
input_fd = fd;
input_from_tty = istty;
read_a_line = readfunc;
diff --git a/doc/ChangeLog b/doc/ChangeLog
index b8f37013..1ac2a958 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawktexi.in: Remove references to MS-DOS and OS/2,
+ simplify the whole section on PC operating systems.
+
2016-10-02 Arnold D. Robbins <arnold@skeeve.com>
* gawktexi.in (Bugs): Rework this section and break into
diff --git a/doc/gawk.info b/doc/gawk.info
index 72703060..afd4972f 100644
--- a/doc/gawk.info
+++ b/doc/gawk.info
@@ -624,14 +624,11 @@ in (a) below. A copy of the license is included in the section entitled
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling
- 'gawk' on MS-DOS and OS/2.
+* PC Installation:: Installing and Compiling 'gawk' on
+ Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling 'gawk' for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing 'gawk' on PC systems.
-* PC Using:: Running 'gawk' on MS-DOS,
- Windows32 and OS/2.
+* PC Compiling:: Compiling 'gawk' for Windows32.
+* PC Using:: Running 'gawk' on Windows32.
* Cygwin:: Building and running 'gawk'
for Cygwin.
* MSYS:: Using 'gawk' In The MSYS
@@ -869,8 +866,7 @@ different computing environments. This Info file, while describing the
of 'awk' called 'gawk' (which stands for "GNU 'awk'"). 'gawk' runs on a
broad range of Unix systems, ranging from Intel-architecture PC-based
computers up through large-scale systems. 'gawk' has also been ported
-to Mac OS X, Microsoft Windows (all versions) and OS/2 PCs, and
-OpenVMS.(3)
+to Mac OS X, Microsoft Windows (all versions), and OpenVMS.(3)
* Menu:
@@ -1515,8 +1511,7 @@ following command line:
'awk' applies the PROGRAM to the "standard input", which usually means
whatever you type on the keyboard. This continues until you indicate
end-of-file by typing 'Ctrl-d'. (On non-POSIX operating systems, the
-end-of-file character may be different. For example, on OS/2, it is
-'Ctrl-z'.)
+end-of-file character may be different.)
As an example, the following program prints a friendly piece of
advice (from Douglas Adams's 'The Hitchhiker's Guide to the Galaxy'), to
@@ -2961,7 +2956,7 @@ been found, and 'gawk' no longer needs to use 'AWKPATH'.
---------- Footnotes ----------
- (1) Semicolons on MS-Windows and MS-DOS.
+ (1) Semicolons on MS-Windows.
(2) Your version of 'gawk' may use a different directory; it will
depend upon how 'gawk' was built and installed. The actual directory is
@@ -28147,8 +28142,8 @@ Various '.c', '.y', and '.h' files
Files needed for building 'gawk' on POSIX-compliant systems.
'pc/*'
- Files needed for building 'gawk' under MS-Windows and OS/2 (*note
- PC Installation:: for details).
+ Files needed for building 'gawk' under MS-Windows (*note PC
+ Installation:: for details).
'vms/*'
Files needed for building 'gawk' under Vax/VMS and OpenVMS (*note
@@ -28367,35 +28362,27 @@ systems.
* Menu:
* PC Installation:: Installing and Compiling 'gawk' on
- MS-DOS and OS/2.
+ Microsoft Windows.
* VMS Installation:: Installing 'gawk' on VMS.

File: gawk.info, Node: PC Installation, Next: VMS Installation, Up: Non-Unix Installation
-B.3.1 Installation on PC Operating Systems
-------------------------------------------
+B.3.1 Installation on MS-Windows
+--------------------------------
This minor node covers installation and usage of 'gawk' on Intel
-architecture machines running MS-DOS, any version of MS-Windows, or
-OS/2. In this minor node, the term "Windows32" refers to any of
-Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8.
+architecture machines running any version of MS-Windows. In this minor
+node, the term "Windows32" refers to any of Microsoft Windows
+95/98/ME/NT/2000/XP/Vista/7/8/10.
- The limitations of MS-DOS (and MS-DOS shells under the other
-operating systems) have meant that various "DOS extenders" are often
-used with programs such as 'gawk'. The varying capabilities of
-Microsoft Windows 3.1 and Windows32 can add to the confusion. For an
-overview of the considerations, refer to 'README_d/README.pc' in the
-distribution.
+ See also the 'README_d/README.pc' file in the distribution.
* Menu:
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling 'gawk' for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing 'gawk' on PC systems.
-* PC Using:: Running 'gawk' on MS-DOS, Windows32
- and OS/2.
+* PC Compiling:: Compiling 'gawk' for Windows32.
+* PC Using:: Running 'gawk' on Windows32.
* Cygwin:: Building and running 'gawk' for
Cygwin.
* MSYS:: Using 'gawk' In The MSYS Environment.
@@ -28403,59 +28390,31 @@ distribution.

File: gawk.info, Node: PC Binary Installation, Next: PC Compiling, Up: PC Installation
-B.3.1.1 Installing a Prepared Distribution for PC Systems
-.........................................................
-
-If you have received a binary distribution prepared by the MS-DOS
-maintainers, then 'gawk' and the necessary support files appear under
-the 'gnu' directory, with executables in 'gnu/bin', libraries in
-'gnu/lib/awk', and manual pages under 'gnu/man'. This is designed for
-easy installation to a '/gnu' directory on your drive--however, the
-files can be installed anywhere provided 'AWKPATH' is set properly.
-Regardless of the installation directory, the first line of 'igawk.cmd'
-and 'igawk.bat' (in 'gnu/bin') may need to be edited.
-
- The binary distribution contains a separate file describing the
-contents. In particular, it may include more than one version of the
-'gawk' executable.
+B.3.1.1 Installing a Prepared Distribution for MS-Windows Systems
+.................................................................
- OS/2 (32 bit, EMX) binary distributions are prepared for the '/usr'
-directory of your preferred drive. Set 'UNIXROOT' to your installation
-drive (e.g., 'e:') if you want to install 'gawk' onto another drive than
-the hardcoded default 'c:'. Executables appear in '/usr/bin', libraries
-under '/usr/share/awk', manual pages under '/usr/man', Texinfo
-documentation under '/usr/info', and NLS files under
-'/usr/share/locale'. Note that the files can be installed anywhere
-provided 'AWKPATH' is set properly.
-
- If you already have a file '/usr/info/dir' from another package _do
-not overwrite it!_ Instead enter the following commands at your prompt
-(replace 'x:' by your installation drive):
-
- install-info --info-dir=x:/usr/info x:/usr/info/gawk.info
- install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info
-
- The binary distribution may contain a separate file containing
-additional or more detailed installation instructions.
+The only supported binary distribution for MS-Windows systems is that
+provided by Eli Zaretskii's "ezwinports"
+(https://sourceforge.net/projects/ezwinports/) project. Install the
+compiled 'gawk' from there.

-File: gawk.info, Node: PC Compiling, Next: PC Testing, Prev: PC Binary Installation, Up: PC Installation
+File: gawk.info, Node: PC Compiling, Next: PC Using, Prev: PC Binary Installation, Up: PC Installation
B.3.1.2 Compiling 'gawk' for PC Operating Systems
.................................................
-'gawk' can be compiled for MS-DOS, Windows32, and OS/2 using MinGW
-(Windows32) or Eberhard Mattes (EMX: MS-DOS, Windows32 and OS/2). The
-file 'README_d/README.pc' in the 'gawk' distribution contains additional
+'gawk' can be compiled for Windows32 using MinGW (Windows32). The file
+'README_d/README.pc' in the 'gawk' distribution contains additional
notes, and 'pc/Makefile' contains important information on compilation
options.
- To build 'gawk' for MS-DOS and Windows32, copy the files in the 'pc'
-directory (_except_ for 'ChangeLog') to the directory with the rest of
-the 'gawk' sources, then invoke 'make' with the appropriate target name
-as an argument to build 'gawk'. The 'Makefile' copied from the 'pc'
-directory contains a configuration section with comments and may need to
-be edited in order to work with your 'make' utility.
+ To build 'gawk' for Windows32, copy the files in the 'pc' directory
+(_except_ for 'ChangeLog') to the directory with the rest of the 'gawk'
+sources, then invoke 'make' with the appropriate target name as an
+argument to build 'gawk'. The 'Makefile' copied from the 'pc' directory
+contains a configuration section with comments and may need to be edited
+in order to work with your 'make' utility.
The 'Makefile' supports a number of targets for building various
MS-DOS and Windows32 versions. A list of targets is printed if the
@@ -28463,120 +28422,25 @@ MS-DOS and Windows32 versions. A list of targets is printed if the
native MS-Windows binary of 'gawk' using the MinGW tools, type 'make
mingw32'.
- The 32 bit EMX version of 'gawk' works "out of the box" under OS/2.
-However, it is highly recommended to use GCC 2.95.3 for the compilation.
-In principle, it is possible to compile 'gawk' the following way:
-
- $ ./configure
- $ make
-
- This is not recommended, though. To get an OMF executable you should
-use the following commands at your 'sh' prompt:
-
- $ CFLAGS="-O2 -Zomf -Zmt"
- $ export CFLAGS
- $ LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"
- $ export LDFLAGS
- $ RANLIB="echo"
- $ export RANLIB
- $ ./configure --prefix=c:/usr
- $ make AR=emxomfar
-
- These are just suggestions for use with GCC 2.x. You may use any
-other set of (self-consistent) environment variables and compiler flags.
-
- If you use GCC 2.95 it is recommended to use also:
-
- $ LIBS="-lgcc"
- $ export LIBS
-
- You can also get an 'a.out' executable if you prefer:
-
- $ CFLAGS="-O2 -Zmt"
- $ export CFLAGS
- $ LDFLAGS="-s -Zstack 0x6000"
- $ LIBS="-lgcc"
- $ unset RANLIB
- $ ./configure --prefix=c:/usr
- $ make
-
- NOTE: Compilation of 'a.out' executables also works with GCC 3.2.
- Versions later than GCC 3.2 have not been tested successfully.
-
- 'make install' works as expected with the EMX build.
-
- NOTE: Ancient OS/2 ports of GNU 'make' are not able to handle the
- Makefiles of this package. If you encounter any problems with
- 'make', try GNU Make 3.79.1 or later versions. You should find the
- latest version on <ftp://hobbes.nmsu.edu/pub/os2/>.(1)
-
- ---------- Footnotes ----------
-
- (1) As of November 2014, this site is still there, but the author
-could not find a package for GNU Make.
-

-File: gawk.info, Node: PC Testing, Next: PC Using, Prev: PC Compiling, Up: PC Installation
-
-B.3.1.3 Testing 'gawk' on PC Operating Systems
-..............................................
+File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Compiling, Up: PC Installation
-Using 'make' to run the standard tests and to install 'gawk' requires
-additional Unix-like tools, including 'sh', 'sed', and 'cp'. In order
-to run the tests, the 'test/*.ok' files may need to be converted so that
-they have the usual MS-DOS-style end-of-line markers. Alternatively,
-run 'make check CMP="diff -a"' to use GNU 'diff' in text mode instead of
-'cmp' to compare the resulting files.
-
- Most of the tests work properly with Stewartson's shell along with
-the companion utilities or appropriate GNU utilities. However, some
-editing of 'test/Makefile' is required. It is recommended that you copy
-the file 'pc/Makefile.tst' over the file 'test/Makefile' as a
-replacement. Details can be found in 'README_d/README.pc' and in the
-file 'pc/Makefile.tst'.
-
- On OS/2 the 'pid' test fails because 'spawnl()' is used instead of
-'fork()'/'execl()' to start child processes. Also the 'mbfw1' and
-'mbprintf1' tests fail because the needed multibyte functionality is not
-available.
-
-
-File: gawk.info, Node: PC Using, Next: Cygwin, Prev: PC Testing, Up: PC Installation
-
-B.3.1.4 Using 'gawk' on PC Operating Systems
+B.3.1.3 Using 'gawk' on PC Operating Systems
............................................
-Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support
-both the '|&' operator and TCP/IP networking (*note TCP/IP
-Networking::). EMX (OS/2 only) supports at least the '|&' operator.
+Under MS-Windows, the Cygwin and MinGW environments support both the
+'|&' operator and TCP/IP networking (*note TCP/IP Networking::).
- The MS-DOS and MS-Windows versions of 'gawk' search for program files
-as described in *note AWKPATH Variable::. However, semicolons (rather
-than colons) separate elements in the 'AWKPATH' variable. If 'AWKPATH'
-is not set or is empty, then the default search path is
+ The MS-Windows version of 'gawk' searches for program files as
+described in *note AWKPATH Variable::. However, semicolons (rather than
+colons) separate elements in the 'AWKPATH' variable. If 'AWKPATH' is
+not set or is empty, then the default search path is
'.;c:/lib/awk;c:/gnu/lib/awk'.
- The search path for OS/2 (32 bit, EMX) is determined by the prefix
-directory (most likely '/usr' or 'c:/usr') that has been specified as an
-option of the 'configure' script as is the case for the Unix versions.
-If 'c:/usr' is the prefix directory then the default search path
-contains '.' and 'c:/usr/share/awk'. Additionally, to support binary
-distributions of 'gawk' for OS/2 systems whose drive 'c:' might not
-support long file names or might not exist at all, there is a special
-environment variable. If 'UNIXROOT' specifies a drive then this
-specific drive is also searched for program files. E.g., if 'UNIXROOT'
-is set to 'e:' the complete default search path is
-'.;c:/usr/share/awk;e:/usr/share/awk'.
-
- An 'sh'-like shell (as opposed to 'command.com' under MS-DOS or
-'cmd.exe' under MS-Windows or OS/2) may be useful for 'awk' programming.
-The DJGPP collection of tools(1) includes an MS-DOS port of Bash, and
-several shells are available for OS/2, including 'ksh'.
-
- Under MS-Windows, OS/2 and MS-DOS, 'gawk' (and many other text
-programs) silently translates end-of-line '\r\n' to '\n' on input and
-'\n' to '\r\n' on output. A special 'BINMODE' variable (c.e.) allows
-control over these translations and is interpreted as follows:
+ Under MS-Windows, 'gawk' (and many other text programs) silently
+translates end-of-line '\r\n' to '\n' on input and '\n' to '\r\n' on
+output. A special 'BINMODE' variable (c.e.) allows control over these
+translations and is interpreted as follows:
* If 'BINMODE' is '"r"' or one, then binary mode is set on read
(i.e., no translations on reads).
@@ -28632,14 +28496,10 @@ or:
With proper quoting, in the first example the setting of 'RS' can be
moved into the 'BEGIN' rule.
- ---------- Footnotes ----------
-
- (1) Available from <ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/>.
-

File: gawk.info, Node: Cygwin, Next: MSYS, Prev: PC Using, Up: PC Installation
-B.3.1.5 Using 'gawk' In The Cygwin Environment
+B.3.1.4 Using 'gawk' In The Cygwin Environment
..............................................
'gawk' can be built and used "out of the box" under MS-Windows if you
@@ -28660,7 +28520,7 @@ the 'make' proceeds as usual.

File: gawk.info, Node: MSYS, Prev: Cygwin, Up: PC Installation
-B.3.1.6 Using 'gawk' In The MSYS Environment
+B.3.1.5 Using 'gawk' In The MSYS Environment
............................................
In the MSYS environment under MS-Windows, 'gawk' automatically uses
@@ -29267,9 +29127,9 @@ B.6 Summary
./configure && make && make check
* 'gawk' may be built on non-POSIX systems as well. The currently
- supported systems are MS-Windows using MSYS, MinGW, and Cygwin,
- OS/2 using EMX, and both Vax/VMS and OpenVMS. Instructions for each
- system are included in this major node.
+ supported systems are MS-Windows using MSYS, MinGW, and Cygwin, and
+ both Vax/VMS and OpenVMS. Instructions for each system are included
+ in this major node.
* Bug reports should be sent via email to <bug-gawk@gnu.org>. Bug
reports should be in English and should include the version of
@@ -32418,7 +32278,7 @@ Index
* /inet/... special files (gawk): TCP/IP Networking. (line 6)
* /inet4/... special files (gawk): TCP/IP Networking. (line 6)
* /inet6/... special files (gawk): TCP/IP Networking. (line 6)
-* ; (semicolon), AWKPATH variable and: PC Using. (line 10)
+* ; (semicolon), AWKPATH variable and: PC Using. (line 9)
* ; (semicolon), separating statements in actions: Statements/Lines.
(line 90)
* ; (semicolon), separating statements in actions <1>: Action Overview.
@@ -32713,7 +32573,7 @@ Index
* awk programs, running: Running gawk. (line 6)
* awk programs, running <1>: Long. (line 6)
* awk programs, running, from shell scripts: One-shot. (line 22)
-* awk programs, running, without input files: Read Terminal. (line 17)
+* awk programs, running, without input files: Read Terminal. (line 16)
* awk programs, shell variables in: Using Shell Variables.
(line 6)
* awk, function of: Getting Started. (line 6)
@@ -32746,7 +32606,7 @@ Index
* awka compiler for awk: Other Versions. (line 68)
* AWKLIBPATH environment variable: AWKLIBPATH Variable. (line 6)
* AWKPATH environment variable: AWKPATH Variable. (line 6)
-* AWKPATH environment variable <1>: PC Using. (line 10)
+* AWKPATH environment variable <1>: PC Using. (line 9)
* awkprof.out file: Profiling. (line 6)
* awksed.awk program: Simple Sed. (line 25)
* awkvars.out file: Options. (line 94)
@@ -32840,7 +32700,7 @@ Index
* bindtextdomain() function (gawk), portability and: I18N Portability.
(line 33)
* BINMODE variable: User-modified. (line 15)
-* BINMODE variable <1>: PC Using. (line 35)
+* BINMODE variable <1>: PC Using. (line 16)
* bit-manipulation functions: Bitwise Functions. (line 6)
* bits2str() user-defined function: Bitwise Functions. (line 72)
* bitwise AND: Bitwise Functions. (line 40)
@@ -33021,7 +32881,7 @@ Index
* common extensions, /dev/stderr special file: Special FD. (line 48)
* common extensions, /dev/stdin special file: Special FD. (line 48)
* common extensions, /dev/stdout special file: Special FD. (line 48)
-* common extensions, BINMODE variable: PC Using. (line 35)
+* common extensions, BINMODE variable: PC Using. (line 16)
* common extensions, delete to delete entire arrays: Delete. (line 39)
* common extensions, func keyword: Definition Syntax. (line 99)
* common extensions, length() applied to an array: String Functions.
@@ -33046,9 +32906,8 @@ Index
* compiled programs: Basic High Level. (line 13)
* compiled programs <1>: Glossary. (line 218)
* compiling gawk for Cygwin: Cygwin. (line 6)
-* compiling gawk for MS-DOS and MS-Windows: PC Compiling. (line 12)
+* compiling gawk for MS-Windows: PC Compiling. (line 11)
* compiling gawk for VMS: VMS Compilation. (line 6)
-* compiling gawk with EMX for OS/2: PC Compiling. (line 25)
* compl: Bitwise Functions. (line 44)
* complement, bitwise: Bitwise Functions. (line 25)
* compound statements, control statements and: Statements. (line 10)
@@ -33322,7 +33181,7 @@ Index
* differences in awk and gawk, BINMODE variable: User-modified.
(line 15)
* differences in awk and gawk, BINMODE variable <1>: PC Using.
- (line 35)
+ (line 16)
* differences in awk and gawk, close() function: Close Files And Pipes.
(line 81)
* differences in awk and gawk, close() function <1>: Close Files And Pipes.
@@ -33555,7 +33414,7 @@ Index
* extensions, common, /dev/stderr special file: Special FD. (line 48)
* extensions, common, /dev/stdin special file: Special FD. (line 48)
* extensions, common, /dev/stdout special file: Special FD. (line 48)
-* extensions, common, BINMODE variable: PC Using. (line 35)
+* extensions, common, BINMODE variable: PC Using. (line 16)
* extensions, common, delete to delete entire arrays: Delete. (line 39)
* extensions, common, fflush() function: I/O Functions. (line 43)
* extensions, common, func keyword: Definition Syntax. (line 99)
@@ -33645,7 +33504,7 @@ Index
* files, descriptors, See file descriptors: Special FD. (line 6)
* files, group: Group Functions. (line 6)
* files, initialization and cleanup: Filetrans Function. (line 6)
-* files, input, See input files: Read Terminal. (line 17)
+* files, input, See input files: Read Terminal. (line 16)
* files, log, timestamps in: Time Functions. (line 6)
* files, managing: Data File Management.
(line 6)
@@ -33856,11 +33715,9 @@ Index
* gawk, line continuation in: Conditional Exp. (line 34)
* gawk, LINT variable in: User-modified. (line 87)
* gawk, list of contributors to: Contributors. (line 6)
-* gawk, MS-DOS version of: PC Using. (line 10)
-* gawk, MS-Windows version of: PC Using. (line 10)
+* gawk, MS-Windows version of: PC Using. (line 9)
* gawk, newlines in: Statements/Lines. (line 12)
* gawk, octal numbers and: Nondecimal-numbers. (line 41)
-* gawk, OS/2 version of: PC Using. (line 17)
* gawk, predefined variables and: Built-in Variables. (line 14)
* gawk, PROCINFO array in: Auto-set. (line 148)
* gawk, PROCINFO array in <1>: Time Functions. (line 47)
@@ -34059,7 +33916,7 @@ Index
* input files, examples: Sample Data Files. (line 6)
* input files, reading: Reading Files. (line 6)
* input files, running awk without: Read Terminal. (line 6)
-* input files, running awk without <1>: Read Terminal. (line 17)
+* input files, running awk without <1>: Read Terminal. (line 16)
* input files, variable assignments and: Other Arguments. (line 26)
* input pipeline: Getline/Pipe. (line 10)
* input record, length of: String Functions. (line 177)
@@ -34868,12 +34725,12 @@ Index
* search and replace in strings: String Functions. (line 89)
* search in string: String Functions. (line 155)
* search paths: Programs Exercises. (line 70)
-* search paths <1>: PC Using. (line 10)
+* search paths <1>: PC Using. (line 9)
* search paths <2>: VMS Running. (line 57)
* search paths, for loadable extensions: AWKLIBPATH Variable. (line 6)
* search paths, for source files: AWKPATH Variable. (line 6)
* search paths, for source files <1>: Programs Exercises. (line 70)
-* search paths, for source files <2>: PC Using. (line 10)
+* search paths, for source files <2>: PC Using. (line 9)
* search paths, for source files <3>: VMS Running. (line 57)
* searching, files for regular expressions: Egrep Program. (line 6)
* searching, for words: Dupword Program. (line 6)
@@ -34881,7 +34738,7 @@ Index
* sed utility <1>: Simple Sed. (line 6)
* sed utility <2>: Glossary. (line 16)
* seeding random number generator: Numeric Functions. (line 79)
-* semicolon (;), AWKPATH variable and: PC Using. (line 10)
+* semicolon (;), AWKPATH variable and: PC Using. (line 9)
* semicolon (;), separating statements in actions: Statements/Lines.
(line 90)
* semicolon (;), separating statements in actions <1>: Action Overview.
@@ -35245,7 +35102,6 @@ Index
* Unix awk, password files, field separators and: Command Line Field Separator.
(line 62)
* Unix, awk scripts and: Executable Scripts. (line 6)
-* UNIXROOT variable, on OS/2 systems: PC Using. (line 17)
* unsigned integers: Computer Arithmetic. (line 41)
* until debugger command: Debugger Execution Control.
(line 82)
@@ -35364,573 +35220,570 @@ Index

Tag Table:
Node: Top1200
-Node: Foreword342713
-Node: Foreword447155
-Node: Preface48687
-Ref: Preface-Footnote-151559
-Ref: Preface-Footnote-251666
-Ref: Preface-Footnote-351900
-Node: History52042
-Node: Names54394
-Ref: Names-Footnote-155488
-Node: This Manual55635
-Ref: This Manual-Footnote-162120
-Node: Conventions62220
-Node: Manual History64574
-Ref: Manual History-Footnote-167569
-Ref: Manual History-Footnote-267610
-Node: How To Contribute67684
-Node: Acknowledgments68813
-Node: Getting Started73699
-Node: Running gawk76138
-Node: One-shot77328
-Node: Read Terminal78591
-Node: Long80623
-Node: Executable Scripts82136
-Ref: Executable Scripts-Footnote-184931
-Node: Comments85034
-Node: Quoting87518
-Node: DOS Quoting93035
-Node: Sample Data Files93710
-Node: Very Simple96305
-Node: Two Rules101207
-Node: More Complex103092
-Node: Statements/Lines105958
-Ref: Statements/Lines-Footnote-1110417
-Node: Other Features110682
-Node: When111618
-Ref: When-Footnote-1113372
-Node: Intro Summary113437
-Node: Invoking Gawk114321
-Node: Command Line115835
-Node: Options116633
-Ref: Options-Footnote-1132732
-Ref: Options-Footnote-2132962
-Node: Other Arguments132987
-Node: Naming Standard Input135934
-Node: Environment Variables137027
-Node: AWKPATH Variable137585
-Ref: AWKPATH Variable-Footnote-1140996
-Ref: AWKPATH Variable-Footnote-2141041
-Node: AWKLIBPATH Variable141302
-Node: Other Environment Variables142559
-Node: Exit Status146380
-Node: Include Files147057
-Node: Loading Shared Libraries150652
-Node: Obsolete152080
-Node: Undocumented152772
-Node: Invoking Summary153069
-Node: Regexp154729
-Node: Regexp Usage156248
-Node: Escape Sequences158285
-Node: Regexp Operators164517
-Ref: Regexp Operators-Footnote-1171933
-Ref: Regexp Operators-Footnote-2172080
-Node: Bracket Expressions172178
-Ref: table-char-classes174654
-Node: Leftmost Longest177791
-Node: Computed Regexps179094
-Node: GNU Regexp Operators182521
-Node: Case-sensitivity186200
-Ref: Case-sensitivity-Footnote-1189096
-Ref: Case-sensitivity-Footnote-2189331
-Node: Strong Regexp Constants189439
-Node: Regexp Summary192381
-Node: Reading Files193987
-Node: Records196150
-Node: awk split records196883
-Node: gawk split records201814
-Ref: gawk split records-Footnote-1206354
-Node: Fields206391
-Node: Nonconstant Fields209132
-Ref: Nonconstant Fields-Footnote-1211368
-Node: Changing Fields211572
-Node: Field Separators217500
-Node: Default Field Splitting220198
-Node: Regexp Field Splitting221316
-Node: Single Character Fields224669
-Node: Command Line Field Separator225729
-Node: Full Line Fields228947
-Ref: Full Line Fields-Footnote-1230469
-Ref: Full Line Fields-Footnote-2230515
-Node: Field Splitting Summary230616
-Node: Constant Size232690
-Node: Splitting By Content237268
-Ref: Splitting By Content-Footnote-1241239
-Node: Multiple Line241402
-Ref: Multiple Line-Footnote-1247284
-Node: Getline247463
-Node: Plain Getline249930
-Node: Getline/Variable252569
-Node: Getline/File253718
-Node: Getline/Variable/File255104
-Ref: Getline/Variable/File-Footnote-1256707
-Node: Getline/Pipe256795
-Node: Getline/Variable/Pipe259500
-Node: Getline/Coprocess260633
-Node: Getline/Variable/Coprocess261898
-Node: Getline Notes262638
-Node: Getline Summary265433
-Ref: table-getline-variants265855
-Node: Read Timeout266603
-Ref: Read Timeout-Footnote-1270509
-Node: Retrying Input270567
-Node: Command-line directories271766
-Node: Input Summary272672
-Node: Input Exercises275844
-Node: Printing276572
-Node: Print278406
-Node: Print Examples279863
-Node: Output Separators282643
-Node: OFMT284660
-Node: Printf286016
-Node: Basic Printf286801
-Node: Control Letters288375
-Node: Format Modifiers292363
-Node: Printf Examples298378
-Node: Redirection300864
-Node: Special FD307705
-Ref: Special FD-Footnote-1310873
-Node: Special Files310947
-Node: Other Inherited Files311564
-Node: Special Network312565
-Node: Special Caveats313425
-Node: Close Files And Pipes314374
-Ref: table-close-pipe-return-values321281
-Ref: Close Files And Pipes-Footnote-1322064
-Ref: Close Files And Pipes-Footnote-2322212
-Node: Nonfatal322364
-Node: Output Summary324689
-Node: Output Exercises325911
-Node: Expressions326590
-Node: Values327778
-Node: Constants328456
-Node: Scalar Constants329147
-Ref: Scalar Constants-Footnote-1330011
-Node: Nondecimal-numbers330261
-Node: Regexp Constants333274
-Node: Using Constant Regexps333800
-Node: Variables336963
-Node: Using Variables337620
-Node: Assignment Options339530
-Node: Conversion341403
-Node: Strings And Numbers341927
-Ref: Strings And Numbers-Footnote-1344990
-Node: Locale influences conversions345099
-Ref: table-locale-affects347857
-Node: All Operators348475
-Node: Arithmetic Ops349104
-Node: Concatenation351610
-Ref: Concatenation-Footnote-1354457
-Node: Assignment Ops354564
-Ref: table-assign-ops359555
-Node: Increment Ops360868
-Node: Truth Values and Conditions364328
-Node: Truth Values365402
-Node: Typing and Comparison366450
-Node: Variable Typing367270
-Node: Comparison Operators370894
-Ref: table-relational-ops371313
-Node: POSIX String Comparison374808
-Ref: POSIX String Comparison-Footnote-1376503
-Ref: POSIX String Comparison-Footnote-2376642
-Node: Boolean Ops376726
-Ref: Boolean Ops-Footnote-1381208
-Node: Conditional Exp381300
-Node: Function Calls383036
-Node: Precedence386913
-Node: Locales390572
-Node: Expressions Summary392204
-Node: Patterns and Actions394777
-Node: Pattern Overview395897
-Node: Regexp Patterns397574
-Node: Expression Patterns398116
-Node: Ranges401897
-Node: BEGIN/END405005
-Node: Using BEGIN/END405766
-Ref: Using BEGIN/END-Footnote-1408502
-Node: I/O And BEGIN/END408608
-Node: BEGINFILE/ENDFILE410922
-Node: Empty413829
-Node: Using Shell Variables414146
-Node: Action Overview416420
-Node: Statements418745
-Node: If Statement420593
-Node: While Statement422088
-Node: Do Statement424116
-Node: For Statement425264
-Node: Switch Statement428422
-Node: Break Statement430808
-Node: Continue Statement432900
-Node: Next Statement434727
-Node: Nextfile Statement437110
-Node: Exit Statement439762
-Node: Built-in Variables442165
-Node: User-modified443298
-Node: Auto-set450884
-Ref: Auto-set-Footnote-1465537
-Ref: Auto-set-Footnote-2465743
-Node: ARGC and ARGV465799
-Node: Pattern Action Summary470012
-Node: Arrays472442
-Node: Array Basics473771
-Node: Array Intro474615
-Ref: figure-array-elements476590
-Ref: Array Intro-Footnote-1479294
-Node: Reference to Elements479422
-Node: Assigning Elements481886
-Node: Array Example482377
-Node: Scanning an Array484136
-Node: Controlling Scanning487158
-Ref: Controlling Scanning-Footnote-1492557
-Node: Numeric Array Subscripts492873
-Node: Uninitialized Subscripts495057
-Node: Delete496676
-Ref: Delete-Footnote-1499428
-Node: Multidimensional499485
-Node: Multiscanning502580
-Node: Arrays of Arrays504171
-Node: Arrays Summary508938
-Node: Functions511031
-Node: Built-in512069
-Node: Calling Built-in513150
-Node: Numeric Functions515146
-Ref: Numeric Functions-Footnote-1519979
-Ref: Numeric Functions-Footnote-2520336
-Ref: Numeric Functions-Footnote-3520384
-Node: String Functions520656
-Ref: String Functions-Footnote-1544160
-Ref: String Functions-Footnote-2544288
-Ref: String Functions-Footnote-3544536
-Node: Gory Details544623
-Ref: table-sub-escapes546414
-Ref: table-sub-proposed547933
-Ref: table-posix-sub549296
-Ref: table-gensub-escapes550837
-Ref: Gory Details-Footnote-1551660
-Node: I/O Functions551814
-Ref: table-system-return-values558396
-Ref: I/O Functions-Footnote-1560376
-Ref: I/O Functions-Footnote-2560524
-Node: Time Functions560644
-Ref: Time Functions-Footnote-1571166
-Ref: Time Functions-Footnote-2571234
-Ref: Time Functions-Footnote-3571392
-Ref: Time Functions-Footnote-4571503
-Ref: Time Functions-Footnote-5571615
-Ref: Time Functions-Footnote-6571842
-Node: Bitwise Functions572108
-Ref: table-bitwise-ops572702
-Ref: Bitwise Functions-Footnote-1577040
-Node: Type Functions577213
-Node: I18N Functions579874
-Node: User-defined581525
-Node: Definition Syntax582330
-Ref: Definition Syntax-Footnote-1588017
-Node: Function Example588088
-Ref: Function Example-Footnote-1591010
-Node: Function Caveats591032
-Node: Calling A Function591550
-Node: Variable Scope592508
-Node: Pass By Value/Reference595502
-Node: Return Statement599001
-Node: Dynamic Typing601980
-Node: Indirect Calls602910
-Ref: Indirect Calls-Footnote-1613161
-Node: Functions Summary613289
-Node: Library Functions615994
-Ref: Library Functions-Footnote-1619601
-Ref: Library Functions-Footnote-2619744
-Node: Library Names619915
-Ref: Library Names-Footnote-1623375
-Ref: Library Names-Footnote-2623598
-Node: General Functions623684
-Node: Strtonum Function624787
-Node: Assert Function627809
-Node: Round Function631135
-Node: Cliff Random Function632676
-Node: Ordinal Functions633692
-Ref: Ordinal Functions-Footnote-1636755
-Ref: Ordinal Functions-Footnote-2637007
-Node: Join Function637217
-Ref: Join Function-Footnote-1638987
-Node: Getlocaltime Function639187
-Node: Readfile Function642929
-Node: Shell Quoting644901
-Node: Data File Management646302
-Node: Filetrans Function646934
-Node: Rewind Function651030
-Node: File Checking652936
-Ref: File Checking-Footnote-1654270
-Node: Empty Files654471
-Node: Ignoring Assigns656450
-Node: Getopt Function658000
-Ref: Getopt Function-Footnote-1669469
-Node: Passwd Functions669669
-Ref: Passwd Functions-Footnote-1678508
-Node: Group Functions678596
-Ref: Group Functions-Footnote-1686494
-Node: Walking Arrays686701
-Node: Library Functions Summary689709
-Node: Library Exercises691115
-Node: Sample Programs691580
-Node: Running Examples692350
-Node: Clones693078
-Node: Cut Program694302
-Node: Egrep Program704231
-Ref: Egrep Program-Footnote-1711743
-Node: Id Program711853
-Node: Split Program715533
-Ref: Split Program-Footnote-1718992
-Node: Tee Program719121
-Node: Uniq Program721911
-Node: Wc Program729337
-Ref: Wc Program-Footnote-1733592
-Node: Miscellaneous Programs733686
-Node: Dupword Program734899
-Node: Alarm Program736929
-Node: Translate Program741784
-Ref: Translate Program-Footnote-1746349
-Node: Labels Program746619
-Ref: Labels Program-Footnote-1749970
-Node: Word Sorting750054
-Node: History Sorting754126
-Node: Extract Program755961
-Node: Simple Sed763490
-Node: Igawk Program766564
-Ref: Igawk Program-Footnote-1780895
-Ref: Igawk Program-Footnote-2781097
-Ref: Igawk Program-Footnote-3781219
-Node: Anagram Program781334
-Node: Signature Program784396
-Node: Programs Summary785643
-Node: Programs Exercises786857
-Ref: Programs Exercises-Footnote-1790986
-Node: Advanced Features791077
-Node: Nondecimal Data793067
-Node: Array Sorting794658
-Node: Controlling Array Traversal795358
-Ref: Controlling Array Traversal-Footnote-1803725
-Node: Array Sorting Functions803843
-Ref: Array Sorting Functions-Footnote-1808934
-Node: Two-way I/O809130
-Ref: Two-way I/O-Footnote-1815680
-Ref: Two-way I/O-Footnote-2815867
-Node: TCP/IP Networking815949
-Node: Profiling819067
-Ref: Profiling-Footnote-1827560
-Node: Advanced Features Summary827883
-Node: Internationalization829727
-Node: I18N and L10N831207
-Node: Explaining gettext831894
-Ref: Explaining gettext-Footnote-1837786
-Ref: Explaining gettext-Footnote-2837971
-Node: Programmer i18n838136
-Ref: Programmer i18n-Footnote-1842991
-Node: Translator i18n843040
-Node: String Extraction843834
-Ref: String Extraction-Footnote-1844966
-Node: Printf Ordering845052
-Ref: Printf Ordering-Footnote-1847838
-Node: I18N Portability847902
-Ref: I18N Portability-Footnote-1850358
-Node: I18N Example850421
-Ref: I18N Example-Footnote-1853227
-Node: Gawk I18N853300
-Node: I18N Summary853945
-Node: Debugger855286
-Node: Debugging856308
-Node: Debugging Concepts856749
-Node: Debugging Terms858558
-Node: Awk Debugging861133
-Node: Sample Debugging Session862039
-Node: Debugger Invocation862573
-Node: Finding The Bug863959
-Node: List of Debugger Commands870437
-Node: Breakpoint Control871770
-Node: Debugger Execution Control875464
-Node: Viewing And Changing Data878826
-Node: Execution Stack882200
-Node: Debugger Info883837
-Node: Miscellaneous Debugger Commands887908
-Node: Readline Support892996
-Node: Limitations893892
-Ref: Limitations-Footnote-1898123
-Node: Debugging Summary898174
-Node: Arbitrary Precision Arithmetic899453
-Node: Computer Arithmetic900869
-Ref: table-numeric-ranges904460
-Ref: Computer Arithmetic-Footnote-1905182
-Node: Math Definitions905239
-Ref: table-ieee-formats908553
-Ref: Math Definitions-Footnote-1909156
-Node: MPFR features909261
-Node: FP Math Caution910978
-Ref: FP Math Caution-Footnote-1912050
-Node: Inexactness of computations912419
-Node: Inexact representation913379
-Node: Comparing FP Values914739
-Node: Errors accumulate915821
-Node: Getting Accuracy917254
-Node: Try To Round919964
-Node: Setting precision920863
-Ref: table-predefined-precision-strings921560
-Node: Setting the rounding mode923390
-Ref: table-gawk-rounding-modes923764
-Ref: Setting the rounding mode-Footnote-1927172
-Node: Arbitrary Precision Integers927351
-Ref: Arbitrary Precision Integers-Footnote-1932268
-Node: POSIX Floating Point Problems932417
-Ref: POSIX Floating Point Problems-Footnote-1936299
-Node: Floating point summary936337
-Node: Dynamic Extensions938527
-Node: Extension Intro940080
-Node: Plugin License941346
-Node: Extension Mechanism Outline942143
-Ref: figure-load-extension942582
-Ref: figure-register-new-function944147
-Ref: figure-call-new-function945239
-Node: Extension API Description947301
-Node: Extension API Functions Introduction948833
-Node: General Data Types953692
-Ref: General Data Types-Footnote-1959647
-Node: Memory Allocation Functions959946
-Ref: Memory Allocation Functions-Footnote-1962791
-Node: Constructor Functions962890
-Node: Registration Functions964635
-Node: Extension Functions965320
-Node: Exit Callback Functions967943
-Node: Extension Version String969193
-Node: Input Parsers969856
-Node: Output Wrappers979738
-Node: Two-way processors984250
-Node: Printing Messages986515
-Ref: Printing Messages-Footnote-1987686
-Node: Updating ERRNO987839
-Node: Requesting Values988578
-Ref: table-value-types-returned989315
-Node: Accessing Parameters990198
-Node: Symbol Table Access991433
-Node: Symbol table by name991945
-Node: Symbol table by cookie993966
-Ref: Symbol table by cookie-Footnote-1998118
-Node: Cached values998182
-Ref: Cached values-Footnote-11001689
-Node: Array Manipulation1001780
-Ref: Array Manipulation-Footnote-11002871
-Node: Array Data Types1002908
-Ref: Array Data Types-Footnote-11005566
-Node: Array Functions1005658
-Node: Flattening Arrays1009516
-Node: Creating Arrays1016424
-Node: Redirection API1021193
-Node: Extension API Variables1024024
-Node: Extension Versioning1024657
-Ref: gawk-api-version1025094
-Node: Extension API Informational Variables1026850
-Node: Extension API Boilerplate1027914
-Node: Finding Extensions1031728
-Node: Extension Example1032287
-Node: Internal File Description1033085
-Node: Internal File Ops1037165
-Ref: Internal File Ops-Footnote-11048927
-Node: Using Internal File Ops1049067
-Ref: Using Internal File Ops-Footnote-11051450
-Node: Extension Samples1051724
-Node: Extension Sample File Functions1053253
-Node: Extension Sample Fnmatch1060902
-Node: Extension Sample Fork1062389
-Node: Extension Sample Inplace1063607
-Node: Extension Sample Ord1066817
-Node: Extension Sample Readdir1067653
-Ref: table-readdir-file-types1068542
-Node: Extension Sample Revout1069347
-Node: Extension Sample Rev2way1069936
-Node: Extension Sample Read write array1070676
-Node: Extension Sample Readfile1072618
-Node: Extension Sample Time1073713
-Node: Extension Sample API Tests1075061
-Node: gawkextlib1075553
-Node: Extension summary1078000
-Node: Extension Exercises1081702
-Node: Language History1083200
-Node: V7/SVR3.11084856
-Node: SVR41087008
-Node: POSIX1088442
-Node: BTL1089821
-Node: POSIX/GNU1090550
-Node: Feature History1096412
-Node: Common Extensions1110782
-Node: Ranges and Locales1112065
-Ref: Ranges and Locales-Footnote-11116681
-Ref: Ranges and Locales-Footnote-21116708
-Ref: Ranges and Locales-Footnote-31116943
-Node: Contributors1117164
-Node: History summary1122724
-Node: Installation1124104
-Node: Gawk Distribution1125048
-Node: Getting1125532
-Node: Extracting1126493
-Node: Distribution contents1128131
-Node: Unix Installation1134225
-Node: Quick Installation1134907
-Node: Shell Startup Files1137321
-Node: Additional Configuration Options1138399
-Node: Configuration Philosophy1140204
-Node: Non-Unix Installation1142573
-Node: PC Installation1143031
-Node: PC Binary Installation1144351
-Node: PC Compiling1146203
-Ref: PC Compiling-Footnote-11148997
-Node: PC Testing1149106
-Node: PC Using1150286
-Ref: PC Using-Footnote-11154439
-Node: Cygwin1154512
-Node: MSYS1155282
-Node: VMS Installation1155783
-Node: VMS Compilation1156574
-Ref: VMS Compilation-Footnote-11157803
-Node: VMS Dynamic Extensions1157861
-Node: VMS Installation Details1159546
-Node: VMS Running1161799
-Node: VMS GNV1166078
-Node: VMS Old Gawk1166813
-Node: Bugs1167284
-Node: Bug address1167947
-Node: Usenet1170344
-Node: Maintainers1171119
-Node: Other Versions1172495
-Node: Installation summary1179079
-Node: Notes1180130
-Node: Compatibility Mode1180995
-Node: Additions1181777
-Node: Accessing The Source1182702
-Node: Adding Code1184137
-Node: New Ports1190356
-Node: Derived Files1194844
-Ref: Derived Files-Footnote-11200329
-Ref: Derived Files-Footnote-21200364
-Ref: Derived Files-Footnote-31200962
-Node: Future Extensions1201076
-Node: Implementation Limitations1201734
-Node: Extension Design1202917
-Node: Old Extension Problems1204071
-Ref: Old Extension Problems-Footnote-11205589
-Node: Extension New Mechanism Goals1205646
-Ref: Extension New Mechanism Goals-Footnote-11209010
-Node: Extension Other Design Decisions1209199
-Node: Extension Future Growth1211312
-Node: Old Extension Mechanism1212148
-Node: Notes summary1213911
-Node: Basic Concepts1215093
-Node: Basic High Level1215774
-Ref: figure-general-flow1216056
-Ref: figure-process-flow1216741
-Ref: Basic High Level-Footnote-11220042
-Node: Basic Data Typing1220227
-Node: Glossary1223555
-Node: Copying1255502
-Node: GNU Free Documentation License1293041
-Node: Index1318159
+Node: Foreword342530
+Node: Foreword446972
+Node: Preface48504
+Ref: Preface-Footnote-151363
+Ref: Preface-Footnote-251470
+Ref: Preface-Footnote-351704
+Node: History51846
+Node: Names54198
+Ref: Names-Footnote-155292
+Node: This Manual55439
+Ref: This Manual-Footnote-161924
+Node: Conventions62024
+Node: Manual History64378
+Ref: Manual History-Footnote-167373
+Ref: Manual History-Footnote-267414
+Node: How To Contribute67488
+Node: Acknowledgments68617
+Node: Getting Started73503
+Node: Running gawk75942
+Node: One-shot77132
+Node: Read Terminal78395
+Node: Long80388
+Node: Executable Scripts81901
+Ref: Executable Scripts-Footnote-184696
+Node: Comments84799
+Node: Quoting87283
+Node: DOS Quoting92800
+Node: Sample Data Files93475
+Node: Very Simple96070
+Node: Two Rules100972
+Node: More Complex102857
+Node: Statements/Lines105723
+Ref: Statements/Lines-Footnote-1110182
+Node: Other Features110447
+Node: When111383
+Ref: When-Footnote-1113137
+Node: Intro Summary113202
+Node: Invoking Gawk114086
+Node: Command Line115600
+Node: Options116398
+Ref: Options-Footnote-1132497
+Ref: Options-Footnote-2132727
+Node: Other Arguments132752
+Node: Naming Standard Input135699
+Node: Environment Variables136792
+Node: AWKPATH Variable137350
+Ref: AWKPATH Variable-Footnote-1140761
+Ref: AWKPATH Variable-Footnote-2140795
+Node: AWKLIBPATH Variable141056
+Node: Other Environment Variables142313
+Node: Exit Status146134
+Node: Include Files146811
+Node: Loading Shared Libraries150406
+Node: Obsolete151834
+Node: Undocumented152526
+Node: Invoking Summary152823
+Node: Regexp154483
+Node: Regexp Usage156002
+Node: Escape Sequences158039
+Node: Regexp Operators164271
+Ref: Regexp Operators-Footnote-1171687
+Ref: Regexp Operators-Footnote-2171834
+Node: Bracket Expressions171932
+Ref: table-char-classes174408
+Node: Leftmost Longest177545
+Node: Computed Regexps178848
+Node: GNU Regexp Operators182275
+Node: Case-sensitivity185954
+Ref: Case-sensitivity-Footnote-1188850
+Ref: Case-sensitivity-Footnote-2189085
+Node: Strong Regexp Constants189193
+Node: Regexp Summary192135
+Node: Reading Files193741
+Node: Records195904
+Node: awk split records196637
+Node: gawk split records201568
+Ref: gawk split records-Footnote-1206108
+Node: Fields206145
+Node: Nonconstant Fields208886
+Ref: Nonconstant Fields-Footnote-1211122
+Node: Changing Fields211326
+Node: Field Separators217254
+Node: Default Field Splitting219952
+Node: Regexp Field Splitting221070
+Node: Single Character Fields224423
+Node: Command Line Field Separator225483
+Node: Full Line Fields228701
+Ref: Full Line Fields-Footnote-1230223
+Ref: Full Line Fields-Footnote-2230269
+Node: Field Splitting Summary230370
+Node: Constant Size232444
+Node: Splitting By Content237022
+Ref: Splitting By Content-Footnote-1240993
+Node: Multiple Line241156
+Ref: Multiple Line-Footnote-1247038
+Node: Getline247217
+Node: Plain Getline249684
+Node: Getline/Variable252323
+Node: Getline/File253472
+Node: Getline/Variable/File254858
+Ref: Getline/Variable/File-Footnote-1256461
+Node: Getline/Pipe256549
+Node: Getline/Variable/Pipe259254
+Node: Getline/Coprocess260387
+Node: Getline/Variable/Coprocess261652
+Node: Getline Notes262392
+Node: Getline Summary265187
+Ref: table-getline-variants265609
+Node: Read Timeout266357
+Ref: Read Timeout-Footnote-1270263
+Node: Retrying Input270321
+Node: Command-line directories271520
+Node: Input Summary272426
+Node: Input Exercises275598
+Node: Printing276326
+Node: Print278160
+Node: Print Examples279617
+Node: Output Separators282397
+Node: OFMT284414
+Node: Printf285770
+Node: Basic Printf286555
+Node: Control Letters288129
+Node: Format Modifiers292117
+Node: Printf Examples298132
+Node: Redirection300618
+Node: Special FD307459
+Ref: Special FD-Footnote-1310627
+Node: Special Files310701
+Node: Other Inherited Files311318
+Node: Special Network312319
+Node: Special Caveats313179
+Node: Close Files And Pipes314128
+Ref: table-close-pipe-return-values321035
+Ref: Close Files And Pipes-Footnote-1321818
+Ref: Close Files And Pipes-Footnote-2321966
+Node: Nonfatal322118
+Node: Output Summary324443
+Node: Output Exercises325665
+Node: Expressions326344
+Node: Values327532
+Node: Constants328210
+Node: Scalar Constants328901
+Ref: Scalar Constants-Footnote-1329765
+Node: Nondecimal-numbers330015
+Node: Regexp Constants333028
+Node: Using Constant Regexps333554
+Node: Variables336717
+Node: Using Variables337374
+Node: Assignment Options339284
+Node: Conversion341157
+Node: Strings And Numbers341681
+Ref: Strings And Numbers-Footnote-1344744
+Node: Locale influences conversions344853
+Ref: table-locale-affects347611
+Node: All Operators348229
+Node: Arithmetic Ops348858
+Node: Concatenation351364
+Ref: Concatenation-Footnote-1354211
+Node: Assignment Ops354318
+Ref: table-assign-ops359309
+Node: Increment Ops360622
+Node: Truth Values and Conditions364082
+Node: Truth Values365156
+Node: Typing and Comparison366204
+Node: Variable Typing367024
+Node: Comparison Operators370648
+Ref: table-relational-ops371067
+Node: POSIX String Comparison374562
+Ref: POSIX String Comparison-Footnote-1376257
+Ref: POSIX String Comparison-Footnote-2376396
+Node: Boolean Ops376480
+Ref: Boolean Ops-Footnote-1380962
+Node: Conditional Exp381054
+Node: Function Calls382790
+Node: Precedence386667
+Node: Locales390326
+Node: Expressions Summary391958
+Node: Patterns and Actions394531
+Node: Pattern Overview395651
+Node: Regexp Patterns397328
+Node: Expression Patterns397870
+Node: Ranges401651
+Node: BEGIN/END404759
+Node: Using BEGIN/END405520
+Ref: Using BEGIN/END-Footnote-1408256
+Node: I/O And BEGIN/END408362
+Node: BEGINFILE/ENDFILE410676
+Node: Empty413583
+Node: Using Shell Variables413900
+Node: Action Overview416174
+Node: Statements418499
+Node: If Statement420347
+Node: While Statement421842
+Node: Do Statement423870
+Node: For Statement425018
+Node: Switch Statement428176
+Node: Break Statement430562
+Node: Continue Statement432654
+Node: Next Statement434481
+Node: Nextfile Statement436864
+Node: Exit Statement439516
+Node: Built-in Variables441919
+Node: User-modified443052
+Node: Auto-set450638
+Ref: Auto-set-Footnote-1465291
+Ref: Auto-set-Footnote-2465497
+Node: ARGC and ARGV465553
+Node: Pattern Action Summary469766
+Node: Arrays472196
+Node: Array Basics473525
+Node: Array Intro474369
+Ref: figure-array-elements476344
+Ref: Array Intro-Footnote-1479048
+Node: Reference to Elements479176
+Node: Assigning Elements481640
+Node: Array Example482131
+Node: Scanning an Array483890
+Node: Controlling Scanning486912
+Ref: Controlling Scanning-Footnote-1492311
+Node: Numeric Array Subscripts492627
+Node: Uninitialized Subscripts494811
+Node: Delete496430
+Ref: Delete-Footnote-1499182
+Node: Multidimensional499239
+Node: Multiscanning502334
+Node: Arrays of Arrays503925
+Node: Arrays Summary508692
+Node: Functions510785
+Node: Built-in511823
+Node: Calling Built-in512904
+Node: Numeric Functions514900
+Ref: Numeric Functions-Footnote-1519733
+Ref: Numeric Functions-Footnote-2520090
+Ref: Numeric Functions-Footnote-3520138
+Node: String Functions520410
+Ref: String Functions-Footnote-1543914
+Ref: String Functions-Footnote-2544042
+Ref: String Functions-Footnote-3544290
+Node: Gory Details544377
+Ref: table-sub-escapes546168
+Ref: table-sub-proposed547687
+Ref: table-posix-sub549050
+Ref: table-gensub-escapes550591
+Ref: Gory Details-Footnote-1551414
+Node: I/O Functions551568
+Ref: table-system-return-values558150
+Ref: I/O Functions-Footnote-1560130
+Ref: I/O Functions-Footnote-2560278
+Node: Time Functions560398
+Ref: Time Functions-Footnote-1570920
+Ref: Time Functions-Footnote-2570988
+Ref: Time Functions-Footnote-3571146
+Ref: Time Functions-Footnote-4571257
+Ref: Time Functions-Footnote-5571369
+Ref: Time Functions-Footnote-6571596
+Node: Bitwise Functions571862
+Ref: table-bitwise-ops572456
+Ref: Bitwise Functions-Footnote-1576794
+Node: Type Functions576967
+Node: I18N Functions579628
+Node: User-defined581279
+Node: Definition Syntax582084
+Ref: Definition Syntax-Footnote-1587771
+Node: Function Example587842
+Ref: Function Example-Footnote-1590764
+Node: Function Caveats590786
+Node: Calling A Function591304
+Node: Variable Scope592262
+Node: Pass By Value/Reference595256
+Node: Return Statement598755
+Node: Dynamic Typing601734
+Node: Indirect Calls602664
+Ref: Indirect Calls-Footnote-1612915
+Node: Functions Summary613043
+Node: Library Functions615748
+Ref: Library Functions-Footnote-1619355
+Ref: Library Functions-Footnote-2619498
+Node: Library Names619669
+Ref: Library Names-Footnote-1623129
+Ref: Library Names-Footnote-2623352
+Node: General Functions623438
+Node: Strtonum Function624541
+Node: Assert Function627563
+Node: Round Function630889
+Node: Cliff Random Function632430
+Node: Ordinal Functions633446
+Ref: Ordinal Functions-Footnote-1636509
+Ref: Ordinal Functions-Footnote-2636761
+Node: Join Function636971
+Ref: Join Function-Footnote-1638741
+Node: Getlocaltime Function638941
+Node: Readfile Function642683
+Node: Shell Quoting644655
+Node: Data File Management646056
+Node: Filetrans Function646688
+Node: Rewind Function650784
+Node: File Checking652690
+Ref: File Checking-Footnote-1654024
+Node: Empty Files654225
+Node: Ignoring Assigns656204
+Node: Getopt Function657754
+Ref: Getopt Function-Footnote-1669223
+Node: Passwd Functions669423
+Ref: Passwd Functions-Footnote-1678262
+Node: Group Functions678350
+Ref: Group Functions-Footnote-1686248
+Node: Walking Arrays686455
+Node: Library Functions Summary689463
+Node: Library Exercises690869
+Node: Sample Programs691334
+Node: Running Examples692104
+Node: Clones692832
+Node: Cut Program694056
+Node: Egrep Program703985
+Ref: Egrep Program-Footnote-1711497
+Node: Id Program711607
+Node: Split Program715287
+Ref: Split Program-Footnote-1718746
+Node: Tee Program718875
+Node: Uniq Program721665
+Node: Wc Program729091
+Ref: Wc Program-Footnote-1733346
+Node: Miscellaneous Programs733440
+Node: Dupword Program734653
+Node: Alarm Program736683
+Node: Translate Program741538
+Ref: Translate Program-Footnote-1746103
+Node: Labels Program746373
+Ref: Labels Program-Footnote-1749724
+Node: Word Sorting749808
+Node: History Sorting753880
+Node: Extract Program755715
+Node: Simple Sed763244
+Node: Igawk Program766318
+Ref: Igawk Program-Footnote-1780649
+Ref: Igawk Program-Footnote-2780851
+Ref: Igawk Program-Footnote-3780973
+Node: Anagram Program781088
+Node: Signature Program784150
+Node: Programs Summary785397
+Node: Programs Exercises786611
+Ref: Programs Exercises-Footnote-1790740
+Node: Advanced Features790831
+Node: Nondecimal Data792821
+Node: Array Sorting794412
+Node: Controlling Array Traversal795112
+Ref: Controlling Array Traversal-Footnote-1803479
+Node: Array Sorting Functions803597
+Ref: Array Sorting Functions-Footnote-1808688
+Node: Two-way I/O808884
+Ref: Two-way I/O-Footnote-1815434
+Ref: Two-way I/O-Footnote-2815621
+Node: TCP/IP Networking815703
+Node: Profiling818821
+Ref: Profiling-Footnote-1827314
+Node: Advanced Features Summary827637
+Node: Internationalization829481
+Node: I18N and L10N830961
+Node: Explaining gettext831648
+Ref: Explaining gettext-Footnote-1837540
+Ref: Explaining gettext-Footnote-2837725
+Node: Programmer i18n837890
+Ref: Programmer i18n-Footnote-1842745
+Node: Translator i18n842794
+Node: String Extraction843588
+Ref: String Extraction-Footnote-1844720
+Node: Printf Ordering844806
+Ref: Printf Ordering-Footnote-1847592
+Node: I18N Portability847656
+Ref: I18N Portability-Footnote-1850112
+Node: I18N Example850175
+Ref: I18N Example-Footnote-1852981
+Node: Gawk I18N853054
+Node: I18N Summary853699
+Node: Debugger855040
+Node: Debugging856062
+Node: Debugging Concepts856503
+Node: Debugging Terms858312
+Node: Awk Debugging860887
+Node: Sample Debugging Session861793
+Node: Debugger Invocation862327
+Node: Finding The Bug863713
+Node: List of Debugger Commands870191
+Node: Breakpoint Control871524
+Node: Debugger Execution Control875218
+Node: Viewing And Changing Data878580
+Node: Execution Stack881954
+Node: Debugger Info883591
+Node: Miscellaneous Debugger Commands887662
+Node: Readline Support892750
+Node: Limitations893646
+Ref: Limitations-Footnote-1897877
+Node: Debugging Summary897928
+Node: Arbitrary Precision Arithmetic899207
+Node: Computer Arithmetic900623
+Ref: table-numeric-ranges904214
+Ref: Computer Arithmetic-Footnote-1904936
+Node: Math Definitions904993
+Ref: table-ieee-formats908307
+Ref: Math Definitions-Footnote-1908910
+Node: MPFR features909015
+Node: FP Math Caution910732
+Ref: FP Math Caution-Footnote-1911804
+Node: Inexactness of computations912173
+Node: Inexact representation913133
+Node: Comparing FP Values914493
+Node: Errors accumulate915575
+Node: Getting Accuracy917008
+Node: Try To Round919718
+Node: Setting precision920617
+Ref: table-predefined-precision-strings921314
+Node: Setting the rounding mode923144
+Ref: table-gawk-rounding-modes923518
+Ref: Setting the rounding mode-Footnote-1926926
+Node: Arbitrary Precision Integers927105
+Ref: Arbitrary Precision Integers-Footnote-1932022
+Node: POSIX Floating Point Problems932171
+Ref: POSIX Floating Point Problems-Footnote-1936053
+Node: Floating point summary936091
+Node: Dynamic Extensions938281
+Node: Extension Intro939834
+Node: Plugin License941100
+Node: Extension Mechanism Outline941897
+Ref: figure-load-extension942336
+Ref: figure-register-new-function943901
+Ref: figure-call-new-function944993
+Node: Extension API Description947055
+Node: Extension API Functions Introduction948587
+Node: General Data Types953446
+Ref: General Data Types-Footnote-1959401
+Node: Memory Allocation Functions959700
+Ref: Memory Allocation Functions-Footnote-1962545
+Node: Constructor Functions962644
+Node: Registration Functions964389
+Node: Extension Functions965074
+Node: Exit Callback Functions967697
+Node: Extension Version String968947
+Node: Input Parsers969610
+Node: Output Wrappers979492
+Node: Two-way processors984004
+Node: Printing Messages986269
+Ref: Printing Messages-Footnote-1987440
+Node: Updating ERRNO987593
+Node: Requesting Values988332
+Ref: table-value-types-returned989069
+Node: Accessing Parameters989952
+Node: Symbol Table Access991187
+Node: Symbol table by name991699
+Node: Symbol table by cookie993720
+Ref: Symbol table by cookie-Footnote-1997872
+Node: Cached values997936
+Ref: Cached values-Footnote-11001443
+Node: Array Manipulation1001534
+Ref: Array Manipulation-Footnote-11002625
+Node: Array Data Types1002662
+Ref: Array Data Types-Footnote-11005320
+Node: Array Functions1005412
+Node: Flattening Arrays1009270
+Node: Creating Arrays1016178
+Node: Redirection API1020947
+Node: Extension API Variables1023778
+Node: Extension Versioning1024411
+Ref: gawk-api-version1024848
+Node: Extension API Informational Variables1026604
+Node: Extension API Boilerplate1027668
+Node: Finding Extensions1031482
+Node: Extension Example1032041
+Node: Internal File Description1032839
+Node: Internal File Ops1036919
+Ref: Internal File Ops-Footnote-11048681
+Node: Using Internal File Ops1048821
+Ref: Using Internal File Ops-Footnote-11051204
+Node: Extension Samples1051478
+Node: Extension Sample File Functions1053007
+Node: Extension Sample Fnmatch1060656
+Node: Extension Sample Fork1062143
+Node: Extension Sample Inplace1063361
+Node: Extension Sample Ord1066571
+Node: Extension Sample Readdir1067407
+Ref: table-readdir-file-types1068296
+Node: Extension Sample Revout1069101
+Node: Extension Sample Rev2way1069690
+Node: Extension Sample Read write array1070430
+Node: Extension Sample Readfile1072372
+Node: Extension Sample Time1073467
+Node: Extension Sample API Tests1074815
+Node: gawkextlib1075307
+Node: Extension summary1077754
+Node: Extension Exercises1081456
+Node: Language History1082954
+Node: V7/SVR3.11084610
+Node: SVR41086762
+Node: POSIX1088196
+Node: BTL1089575
+Node: POSIX/GNU1090304
+Node: Feature History1096166
+Node: Common Extensions1110536
+Node: Ranges and Locales1111819
+Ref: Ranges and Locales-Footnote-11116435
+Ref: Ranges and Locales-Footnote-21116462
+Ref: Ranges and Locales-Footnote-31116697
+Node: Contributors1116918
+Node: History summary1122478
+Node: Installation1123858
+Node: Gawk Distribution1124802
+Node: Getting1125286
+Node: Extracting1126247
+Node: Distribution contents1127885
+Node: Unix Installation1133970
+Node: Quick Installation1134652
+Node: Shell Startup Files1137066
+Node: Additional Configuration Options1138144
+Node: Configuration Philosophy1139949
+Node: Non-Unix Installation1142318
+Node: PC Installation1142778
+Node: PC Binary Installation1143616
+Node: PC Compiling1144051
+Node: PC Using1145168
+Node: Cygwin1148213
+Node: MSYS1148983
+Node: VMS Installation1149484
+Node: VMS Compilation1150275
+Ref: VMS Compilation-Footnote-11151504
+Node: VMS Dynamic Extensions1151562
+Node: VMS Installation Details1153247
+Node: VMS Running1155500
+Node: VMS GNV1159779
+Node: VMS Old Gawk1160514
+Node: Bugs1160985
+Node: Bug address1161648
+Node: Usenet1164045
+Node: Maintainers1164820
+Node: Other Versions1166196
+Node: Installation summary1172780
+Node: Notes1173815
+Node: Compatibility Mode1174680
+Node: Additions1175462
+Node: Accessing The Source1176387
+Node: Adding Code1177822
+Node: New Ports1184041
+Node: Derived Files1188529
+Ref: Derived Files-Footnote-11194014
+Ref: Derived Files-Footnote-21194049
+Ref: Derived Files-Footnote-31194647
+Node: Future Extensions1194761
+Node: Implementation Limitations1195419
+Node: Extension Design1196602
+Node: Old Extension Problems1197756
+Ref: Old Extension Problems-Footnote-11199274
+Node: Extension New Mechanism Goals1199331
+Ref: Extension New Mechanism Goals-Footnote-11202695
+Node: Extension Other Design Decisions1202884
+Node: Extension Future Growth1204997
+Node: Old Extension Mechanism1205833
+Node: Notes summary1207596
+Node: Basic Concepts1208778
+Node: Basic High Level1209459
+Ref: figure-general-flow1209741
+Ref: figure-process-flow1210426
+Ref: Basic High Level-Footnote-11213727
+Node: Basic Data Typing1213912
+Node: Glossary1217240
+Node: Copying1249187
+Node: GNU Free Documentation License1286726
+Node: Index1311844

End Tag Table
diff --git a/doc/gawk.texi b/doc/gawk.texi
index 5270d419..dd4af936 100644
--- a/doc/gawk.texi
+++ b/doc/gawk.texi
@@ -988,14 +988,11 @@ particular records in a file and perform operations upon them.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling
- @command{gawk} on MS-DOS and OS/2.
+* PC Installation:: Installing and Compiling @command{gawk} on
+ Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS,
- Windows32 and OS/2.
+* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk}
for Cygwin.
* MSYS:: Using @command{gawk} In The MSYS
@@ -1377,12 +1374,7 @@ ranging from Intel-architecture PC-based computers
up through large-scale systems.
@command{gawk} has also been ported to Mac OS X,
Microsoft Windows
-@ifset FOR_PRINT
(all versions),
-@end ifset
-@ifclear FOR_PRINT
-(all versions) and OS/2 PCs,
-@end ifclear
and OpenVMS.@footnote{Some other, obsolete systems to which @command{gawk}
was once ported are no longer supported and the code for those systems
has been removed.}
@@ -2487,13 +2479,7 @@ awk '@var{program}'
@command{awk} applies the @var{program} to the @dfn{standard input},
which usually means whatever you type on the keyboard. This continues
until you indicate end-of-file by typing @kbd{Ctrl-d}.
-@ifset FOR_PRINT
(On non-POSIX operating systems, the end-of-file character may be different.)
-@end ifset
-@ifclear FOR_PRINT
-(On non-POSIX operating systems, the end-of-file character may be different.
-For example, on OS/2, it is @kbd{Ctrl-z}.)
-@end ifclear
@cindex files, input, See input files
@cindex input files, running @command{awk} without
@@ -4430,7 +4416,7 @@ directories (called the @dfn{search path}) one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
-separated by colons.@footnote{Semicolons on MS-Windows and MS-DOS.}
+separated by colons.@footnote{Semicolons on MS-Windows.}
@command{gawk} gets its search path from the
@env{AWKPATH} environment variable. If that variable does not exist,
or if it has an empty value,
@@ -23067,7 +23053,6 @@ is as follows:
* December 2010, move to ANSI C definition for main().
*/
-/* For OS/2, do nothing. */
#if HAVE_CONFIG_H
#include <config.h>
#endif
@@ -38085,9 +38070,6 @@ Files needed for building @command{gawk} on POSIX-compliant systems.
@item pc/*
Files needed for building @command{gawk} under MS-Windows
-@ifclear FOR_PRINT
-and OS/2
-@end ifclear
(@pxref{PC Installation} for details).
@item vms/*
@@ -38345,108 +38327,48 @@ various non-Unix systems.
@menu
* PC Installation:: Installing and Compiling @command{gawk} on
- MS-DOS and OS/2.
+ Microsoft Windows.
* VMS Installation:: Installing @command{gawk} on VMS.
@end menu
-@c Rewritten by Scott Deifik <scottd.mail@sbcglobal.net>
-@c and Darrel Hankerson <hankedr@mail.auburn.edu>
-
@node PC Installation
-@appendixsubsec Installation on PC Operating Systems
+@appendixsubsec Installation on MS-Windows
@cindex PC operating systems@comma{} @command{gawk} on, installing
@cindex operating systems, PC@comma{} @command{gawk} on, installing
This @value{SECTION} covers installation and usage of @command{gawk}
-on Intel architecture machines
-@ifclear FOR_PRINT
-running MS-DOS, any version of MS-Windows, or OS/2.
-@end ifclear
-@ifset FOR_PRINT
-running MS-DOS and any version of MS-Windows.
-@end ifset
+on Intel architecture machines running any version of MS-Windows.
In this @value{SECTION}, the term ``Windows32''
-refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8.
+refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8/10.
-The limitations of MS-DOS (and MS-DOS shells under the other operating
-systems) have meant that various ``DOS extenders'' are often used with
-programs such as @command{gawk}. The varying capabilities of Microsoft
-Windows 3.1 and Windows32 can add to the confusion. For an overview
-of the considerations, refer to @file{README_d/README.pc} in
-the distribution.
+See also the @file{README_d/README.pc} file in the distribution.
@menu
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS, Windows32
- and OS/2.
+* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk} for
Cygwin.
* MSYS:: Using @command{gawk} In The MSYS Environment.
@end menu
-@ifclear FOR_PRINT
@node PC Binary Installation
-@appendixsubsubsec Installing a Prepared Distribution for PC Systems
-
-If you have received a binary distribution prepared by the MS-DOS
-maintainers, then @command{gawk} and the necessary support files appear
-under the @file{gnu} directory, with executables in @file{gnu/bin},
-libraries in @file{gnu/lib/awk}, and manual pages under @file{gnu/man}.
-This is designed for easy installation to a @file{/gnu} directory on your
-drive---however, the files can be installed anywhere provided @env{AWKPATH} is
-set properly. Regardless of the installation directory, the first line of
-@file{igawk.cmd} and @file{igawk.bat} (in @file{gnu/bin}) may need to be
-edited.
-
-The binary distribution contains a separate file describing the
-contents. In particular, it may include more than one version of the
-@command{gawk} executable.
-
-OS/2 (32 bit, EMX) binary distributions are prepared for the @file{/usr}
-directory of your preferred drive. Set @env{UNIXROOT} to your installation
-drive (e.g., @samp{e:}) if you want to install @command{gawk} onto another drive
-than the hardcoded default @samp{c:}. Executables appear in @file{/usr/bin},
-libraries under @file{/usr/share/awk}, manual pages under @file{/usr/man},
-Texinfo documentation under @file{/usr/info}, and NLS files
-under @file{/usr/share/locale}.
-Note that the files can be installed anywhere provided @env{AWKPATH} is
-set properly.
-
-If you already have a file @file{/usr/info/dir} from another package
-@emph{do not overwrite it!} Instead enter the following commands at your prompt
-(replace @samp{x:} by your installation drive):
-
-@example
-install-info --info-dir=x:/usr/info x:/usr/info/gawk.info
-install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info
-@end example
-
-The binary distribution may contain a separate file containing additional
-or more detailed installation instructions.
-@end ifclear
+@appendixsubsubsec Installing a Prepared Distribution for MS-Windows Systems
+
+The only supported binary distribution for MS-Windows systems
+is that provided by Eli Zaretskii's @uref{https://sourceforge.net/projects/ezwinports/,
+``ezwinports''} project. Install the compiled @command{gawk} from there.
@node PC Compiling
@appendixsubsubsec Compiling @command{gawk} for PC Operating Systems
-@ifclear FOR_PRINT
-@command{gawk} can be compiled for MS-DOS, Windows32, and OS/2 using
-MinGW (Windows32) or Eberhard
-Mattes (EMX: MS-DOS, Windows32 and OS/2).
-@end ifclear
-@ifset FOR_PRINT
-@command{gawk} can be compiled for Windows32 using
-MinGW.
-@end ifset
-The file
-@file{README_d/README.pc} in the @command{gawk} distribution contains
-additional notes, and @file{pc/Makefile} contains important information on
-compilation options.
+@command{gawk} can be compiled for Windows32 using MinGW (Windows32).
+The file @file{README_d/README.pc} in the @command{gawk} distribution
+contains additional notes, and @file{pc/Makefile} contains important
+information on compilation options.
-@cindex compiling @command{gawk} for MS-DOS and MS-Windows
-To build @command{gawk} for MS-DOS and Windows32, copy the files in
+@cindex compiling @command{gawk} for MS-Windows
+To build @command{gawk} for Windows32, copy the files in
the @file{pc} directory (@emph{except} for @file{ChangeLog}) to the
directory with the rest of the @command{gawk} sources, then invoke
@command{make} with the appropriate target name as an argument to
@@ -38457,177 +38379,35 @@ to be edited in order to work with your @command{make} utility.
The @file{Makefile} supports a number of targets for building various
MS-DOS and Windows32 versions. A list of targets is printed if the
@command{make} command is given without a target. As an example,
-to build a
-native MS-Windows binary of @command{gawk} using the MinGW tools,
+to build a native MS-Windows binary of @command{gawk} using the MinGW tools,
type @samp{make mingw32}.
-@ifclear FOR_PRINT
-@cindex compiling @command{gawk} with EMX for OS/2
-The 32 bit EMX version of @command{gawk} works ``out of the box'' under OS/2.
-However, it is highly recommended to use GCC 2.95.3 for the compilation.
-In principle, it is possible to compile @command{gawk} the following way:
-
-@example
-$ @kbd{./configure}
-$ @kbd{make}
-@end example
-
-This is not recommended, though. To get an OMF executable you should
-use the following commands at your @command{sh} prompt:
-
-@example
-$ @kbd{CFLAGS="-O2 -Zomf -Zmt"}
-$ @kbd{export CFLAGS}
-$ @kbd{LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"}
-$ @kbd{export LDFLAGS}
-$ @kbd{RANLIB="echo"}
-$ @kbd{export RANLIB}
-$ @kbd{./configure --prefix=c:/usr}
-$ @kbd{make AR=emxomfar}
-@end example
-
-These are just suggestions for use with GCC 2.x. You may use any other set of
-(self-consistent) environment variables and compiler flags.
-
-@ignore
-To get an FHS-compliant file hierarchy it is recommended to use the additional
-@command{configure} options @option{--infodir=c:/usr/share/info}, @option{--mandir=c:/usr/share/man}
-and @option{--libexecdir=c:/usr/lib}.
-@end ignore
-
-@ignore
-The internal @command{gettext} library tends to be problematic. It is therefore recommended
-to use either an external one (@option{--without-included-gettext}) or to disable
-NLS entirely (@option{--disable-nls}).
-@end ignore
-
-If you use GCC 2.95 it is recommended to use also:
-
-@example
-$ @kbd{LIBS="-lgcc"}
-$ @kbd{export LIBS}
-@end example
-
-You can also get an @code{a.out} executable if you prefer:
-
-@example
-$ @kbd{CFLAGS="-O2 -Zmt"}
-$ @kbd{export CFLAGS}
-$ @kbd{LDFLAGS="-s -Zstack 0x6000"}
-$ @kbd{LIBS="-lgcc"}
-$ @kbd{unset RANLIB}
-@c $ ./configure --prefix=c:/usr --without-included-gettext
-$ @kbd{./configure --prefix=c:/usr}
-$ @kbd{make}
-@end example
-
-@quotation NOTE
-Compilation of @code{a.out} executables also works with GCC 3.2.
-Versions later than GCC 3.2 have not been tested successfully.
-@end quotation
-
-@samp{make install} works as expected with the EMX build.
-
-@quotation NOTE
-Ancient OS/2 ports of GNU @command{make} are not able to handle
-the Makefiles of this package. If you encounter any problems with
-@command{make}, try GNU Make 3.79.1 or later versions. You should
-find the latest version on
-@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of November 2014,
-this site is still there, but the author could not find a package
-for GNU Make.}
-@end quotation
-@end ifclear
-
-@node PC Testing
-@appendixsubsubsec Testing @command{gawk} on PC Operating Systems
-
-Using @command{make} to run the standard tests and to install @command{gawk}
-requires additional Unix-like tools, including @command{sh}, @command{sed}, and
-@command{cp}. In order to run the tests, the @file{test/*.ok} files may need to
-be converted so that they have the usual MS-DOS-style end-of-line markers.
-Alternatively, run @command{make check CMP="diff -a"} to use GNU @command{diff}
-in text mode instead of @command{cmp} to compare the resulting files.
-
-@ifclear FOR_PRINT
-Most
-of the tests work properly with Stewartson's shell along with the
-companion utilities or appropriate GNU utilities. However, some editing of
-@file{test/Makefile} is required. It is recommended that you copy the file
-@file{pc/Makefile.tst} over the file @file{test/Makefile} as a
-replacement. Details can be found in @file{README_d/README.pc}
-and in the file @file{pc/Makefile.tst}.
-
-On OS/2 the @code{pid} test fails because @code{spawnl()} is used instead of
-@code{fork()}/@code{execl()} to start child processes.
-Also the @code{mbfw1} and @code{mbprintf1} tests fail because the needed
-multibyte functionality is not available.
-@end ifclear
-
@node PC Using
@appendixsubsubsec Using @command{gawk} on PC Operating Systems
@cindex operating systems, PC, @command{gawk} on
@cindex PC operating systems, @command{gawk} on
-Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support
+Under MS-Windows, the Cygwin and MinGW environments support
both the @samp{|&} operator and TCP/IP networking
(@pxref{TCP/IP Networking}).
-@ifclear FOR_PRINT
-EMX (OS/2 only) supports at least the @samp{|&} operator.
-@end ifclear
@cindex search paths
@cindex search paths, for source files
-@cindex @command{gawk}, MS-DOS version of
@cindex @command{gawk}, MS-Windows version of
@cindex @code{;} (semicolon), @env{AWKPATH} variable and
@cindex semicolon (@code{;}), @env{AWKPATH} variable and
@cindex @env{AWKPATH} environment variable
-The MS-DOS and MS-Windows versions of @command{gawk} search for
+The MS-Windows version of @command{gawk} searches for
program files as described in @ref{AWKPATH Variable}. However,
semicolons (rather than colons) separate elements in the @env{AWKPATH}
variable. If @env{AWKPATH} is not set or is empty, then the default
search path is @samp{@w{.;c:/lib/awk;c:/gnu/lib/awk}}.
-@ifclear FOR_PRINT
-@cindex @command{gawk}, OS/2 version of
-@cindex @code{UNIXROOT} variable, on OS/2 systems
-The search path for OS/2 (32 bit, EMX) is determined by the prefix directory
-(most likely @file{/usr} or @file{c:/usr}) that has been specified as an option of
-the @command{configure} script as is the case for the Unix versions.
-If @file{c:/usr} is the prefix directory then the default search path contains @file{.}
-and @file{c:/usr/share/awk}.
-Additionally, to support binary distributions of @command{gawk} for OS/2
-systems whose drive @samp{c:} might not support long @value{FN}s or might not exist
-at all, there is a special environment variable. If @env{UNIXROOT} specifies
-a drive then this specific drive is also searched for program files.
-E.g., if @env{UNIXROOT} is set to @file{e:} the complete default search path is
-@samp{@w{.;c:/usr/share/awk;e:/usr/share/awk}}.
-
-An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS
-or @command{cmd.exe} under MS-Windows or OS/2) may be useful for @command{awk} programming.
-The DJGPP collection of tools@footnote{Available from
-@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}.}
-includes an MS-DOS port of Bash,
-and several shells are available for OS/2, including @command{ksh}.
-@end ifclear
-@ifset FOR_PRINT
-An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS
-or @command{cmd.exe} under MS-Windows) may be useful for @command{awk} programming.
-The DJGPP collection of tools@footnote{Available from
-@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}.} includes an MS-DOS port of Bash.
-@end ifset
-
@cindex common extensions, @code{BINMODE} variable
@cindex extensions, common@comma{} @code{BINMODE} variable
@cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable
@cindex @code{BINMODE} variable
-@ifclear FOR_PRINT
-Under MS-Windows, OS/2 and MS-DOS,
-@end ifclear
-@ifset FOR_PRINT
-Under MS-Windows and MS-DOS,
-@end ifset
+Under MS-Windows,
@command{gawk} (and many other text programs) silently
translates end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n}
to @samp{\r\n} on output. A special @code{BINMODE} variable @value{COMMONEXT}
@@ -39259,8 +39039,8 @@ The people maintaining the various @command{gawk} ports are:
@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}
-@c Leave this in the print version on purpose.
-@c OS/2 is not mentioned anywhere else in the print version though.
+@c Leave this in the document on purpose.
+@c OS/2 is not mentioned anywhere else though.
@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de}
@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net}
@@ -39520,9 +39300,6 @@ cd gawk-@value{VERSION}.@value{PATCHLEVEL}
@command{gawk} may be built on non-POSIX systems as well. The currently
supported systems are MS-Windows using
MSYS, MinGW, and Cygwin,
-@ifclear FOR_PRINT
-OS/2 using EMX,
-@end ifclear
and both Vax/VMS and OpenVMS.
Instructions for each system are included in this @value{APPENDIX}.
@@ -43015,7 +42792,7 @@ Consistency issues:
Use @code{xxx} for the xxx operator in indexing statements, not @samp.
Use MS-Windows not MS Windows
- Use MS-DOS not MS-DOS
+ Use MS-DOS not MS DOS
Use an empty set of parentheses after built-in and awk function names.
Use "multiFOO" without a hyphen.
diff --git a/doc/gawktexi.in b/doc/gawktexi.in
index 322f3a2f..6dae0186 100644
--- a/doc/gawktexi.in
+++ b/doc/gawktexi.in
@@ -983,14 +983,11 @@ particular records in a file and perform operations upon them.
* Configuration Philosophy:: How it's all supposed to work.
* Non-Unix Installation:: Installation on Other Operating
Systems.
-* PC Installation:: Installing and Compiling
- @command{gawk} on MS-DOS and OS/2.
+* PC Installation:: Installing and Compiling @command{gawk} on
+ Microsoft Windows.
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS,
- Windows32 and OS/2.
+* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk}
for Cygwin.
* MSYS:: Using @command{gawk} In The MSYS
@@ -1372,12 +1369,7 @@ ranging from Intel-architecture PC-based computers
up through large-scale systems.
@command{gawk} has also been ported to Mac OS X,
Microsoft Windows
-@ifset FOR_PRINT
(all versions),
-@end ifset
-@ifclear FOR_PRINT
-(all versions) and OS/2 PCs,
-@end ifclear
and OpenVMS.@footnote{Some other, obsolete systems to which @command{gawk}
was once ported are no longer supported and the code for those systems
has been removed.}
@@ -2454,13 +2446,7 @@ awk '@var{program}'
@command{awk} applies the @var{program} to the @dfn{standard input},
which usually means whatever you type on the keyboard. This continues
until you indicate end-of-file by typing @kbd{Ctrl-d}.
-@ifset FOR_PRINT
(On non-POSIX operating systems, the end-of-file character may be different.)
-@end ifset
-@ifclear FOR_PRINT
-(On non-POSIX operating systems, the end-of-file character may be different.
-For example, on OS/2, it is @kbd{Ctrl-z}.)
-@end ifclear
@cindex files, input, See input files
@cindex input files, running @command{awk} without
@@ -4341,7 +4327,7 @@ directories (called the @dfn{search path}) one by one, looking for a
file with the specified name.
The search path is a string consisting of directory names
-separated by colons.@footnote{Semicolons on MS-Windows and MS-DOS.}
+separated by colons.@footnote{Semicolons on MS-Windows.}
@command{gawk} gets its search path from the
@env{AWKPATH} environment variable. If that variable does not exist,
or if it has an empty value,
@@ -22149,7 +22135,6 @@ is as follows:
* December 2010, move to ANSI C definition for main().
*/
-/* For OS/2, do nothing. */
#if HAVE_CONFIG_H
#include <config.h>
#endif
@@ -37167,9 +37152,6 @@ Files needed for building @command{gawk} on POSIX-compliant systems.
@item pc/*
Files needed for building @command{gawk} under MS-Windows
-@ifclear FOR_PRINT
-and OS/2
-@end ifclear
(@pxref{PC Installation} for details).
@item vms/*
@@ -37427,108 +37409,48 @@ various non-Unix systems.
@menu
* PC Installation:: Installing and Compiling @command{gawk} on
- MS-DOS and OS/2.
+ Microsoft Windows.
* VMS Installation:: Installing @command{gawk} on VMS.
@end menu
-@c Rewritten by Scott Deifik <scottd.mail@sbcglobal.net>
-@c and Darrel Hankerson <hankedr@mail.auburn.edu>
-
@node PC Installation
-@appendixsubsec Installation on PC Operating Systems
+@appendixsubsec Installation on MS-Windows
@cindex PC operating systems@comma{} @command{gawk} on, installing
@cindex operating systems, PC@comma{} @command{gawk} on, installing
This @value{SECTION} covers installation and usage of @command{gawk}
-on Intel architecture machines
-@ifclear FOR_PRINT
-running MS-DOS, any version of MS-Windows, or OS/2.
-@end ifclear
-@ifset FOR_PRINT
-running MS-DOS and any version of MS-Windows.
-@end ifset
+on Intel architecture machines running any version of MS-Windows.
In this @value{SECTION}, the term ``Windows32''
-refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8.
+refers to any of Microsoft Windows 95/98/ME/NT/2000/XP/Vista/7/8/10.
-The limitations of MS-DOS (and MS-DOS shells under the other operating
-systems) have meant that various ``DOS extenders'' are often used with
-programs such as @command{gawk}. The varying capabilities of Microsoft
-Windows 3.1 and Windows32 can add to the confusion. For an overview
-of the considerations, refer to @file{README_d/README.pc} in
-the distribution.
+See also the @file{README_d/README.pc} file in the distribution.
@menu
* PC Binary Installation:: Installing a prepared distribution.
-* PC Compiling:: Compiling @command{gawk} for MS-DOS,
- Windows32, and OS/2.
-* PC Testing:: Testing @command{gawk} on PC systems.
-* PC Using:: Running @command{gawk} on MS-DOS, Windows32
- and OS/2.
+* PC Compiling:: Compiling @command{gawk} for Windows32.
+* PC Using:: Running @command{gawk} on Windows32.
* Cygwin:: Building and running @command{gawk} for
Cygwin.
* MSYS:: Using @command{gawk} In The MSYS Environment.
@end menu
-@ifclear FOR_PRINT
@node PC Binary Installation
-@appendixsubsubsec Installing a Prepared Distribution for PC Systems
-
-If you have received a binary distribution prepared by the MS-DOS
-maintainers, then @command{gawk} and the necessary support files appear
-under the @file{gnu} directory, with executables in @file{gnu/bin},
-libraries in @file{gnu/lib/awk}, and manual pages under @file{gnu/man}.
-This is designed for easy installation to a @file{/gnu} directory on your
-drive---however, the files can be installed anywhere provided @env{AWKPATH} is
-set properly. Regardless of the installation directory, the first line of
-@file{igawk.cmd} and @file{igawk.bat} (in @file{gnu/bin}) may need to be
-edited.
-
-The binary distribution contains a separate file describing the
-contents. In particular, it may include more than one version of the
-@command{gawk} executable.
-
-OS/2 (32 bit, EMX) binary distributions are prepared for the @file{/usr}
-directory of your preferred drive. Set @env{UNIXROOT} to your installation
-drive (e.g., @samp{e:}) if you want to install @command{gawk} onto another drive
-than the hardcoded default @samp{c:}. Executables appear in @file{/usr/bin},
-libraries under @file{/usr/share/awk}, manual pages under @file{/usr/man},
-Texinfo documentation under @file{/usr/info}, and NLS files
-under @file{/usr/share/locale}.
-Note that the files can be installed anywhere provided @env{AWKPATH} is
-set properly.
-
-If you already have a file @file{/usr/info/dir} from another package
-@emph{do not overwrite it!} Instead enter the following commands at your prompt
-(replace @samp{x:} by your installation drive):
-
-@example
-install-info --info-dir=x:/usr/info x:/usr/info/gawk.info
-install-info --info-dir=x:/usr/info x:/usr/info/gawkinet.info
-@end example
-
-The binary distribution may contain a separate file containing additional
-or more detailed installation instructions.
-@end ifclear
+@appendixsubsubsec Installing a Prepared Distribution for MS-Windows Systems
+
+The only supported binary distribution for MS-Windows systems
+is that provided by Eli Zaretskii's @uref{https://sourceforge.net/projects/ezwinports/,
+``ezwinports''} project. Install the compiled @command{gawk} from there.
@node PC Compiling
@appendixsubsubsec Compiling @command{gawk} for PC Operating Systems
-@ifclear FOR_PRINT
-@command{gawk} can be compiled for MS-DOS, Windows32, and OS/2 using
-MinGW (Windows32) or Eberhard
-Mattes (EMX: MS-DOS, Windows32 and OS/2).
-@end ifclear
-@ifset FOR_PRINT
-@command{gawk} can be compiled for Windows32 using
-MinGW.
-@end ifset
-The file
-@file{README_d/README.pc} in the @command{gawk} distribution contains
-additional notes, and @file{pc/Makefile} contains important information on
-compilation options.
+@command{gawk} can be compiled for Windows32 using MinGW (Windows32).
+The file @file{README_d/README.pc} in the @command{gawk} distribution
+contains additional notes, and @file{pc/Makefile} contains important
+information on compilation options.
-@cindex compiling @command{gawk} for MS-DOS and MS-Windows
-To build @command{gawk} for MS-DOS and Windows32, copy the files in
+@cindex compiling @command{gawk} for MS-Windows
+To build @command{gawk} for Windows32, copy the files in
the @file{pc} directory (@emph{except} for @file{ChangeLog}) to the
directory with the rest of the @command{gawk} sources, then invoke
@command{make} with the appropriate target name as an argument to
@@ -37539,177 +37461,35 @@ to be edited in order to work with your @command{make} utility.
The @file{Makefile} supports a number of targets for building various
MS-DOS and Windows32 versions. A list of targets is printed if the
@command{make} command is given without a target. As an example,
-to build a
-native MS-Windows binary of @command{gawk} using the MinGW tools,
+to build a native MS-Windows binary of @command{gawk} using the MinGW tools,
type @samp{make mingw32}.
-@ifclear FOR_PRINT
-@cindex compiling @command{gawk} with EMX for OS/2
-The 32 bit EMX version of @command{gawk} works ``out of the box'' under OS/2.
-However, it is highly recommended to use GCC 2.95.3 for the compilation.
-In principle, it is possible to compile @command{gawk} the following way:
-
-@example
-$ @kbd{./configure}
-$ @kbd{make}
-@end example
-
-This is not recommended, though. To get an OMF executable you should
-use the following commands at your @command{sh} prompt:
-
-@example
-$ @kbd{CFLAGS="-O2 -Zomf -Zmt"}
-$ @kbd{export CFLAGS}
-$ @kbd{LDFLAGS="-s -Zcrtdll -Zlinker /exepack:2 -Zlinker /pm:vio -Zstack 0x6000"}
-$ @kbd{export LDFLAGS}
-$ @kbd{RANLIB="echo"}
-$ @kbd{export RANLIB}
-$ @kbd{./configure --prefix=c:/usr}
-$ @kbd{make AR=emxomfar}
-@end example
-
-These are just suggestions for use with GCC 2.x. You may use any other set of
-(self-consistent) environment variables and compiler flags.
-
-@ignore
-To get an FHS-compliant file hierarchy it is recommended to use the additional
-@command{configure} options @option{--infodir=c:/usr/share/info}, @option{--mandir=c:/usr/share/man}
-and @option{--libexecdir=c:/usr/lib}.
-@end ignore
-
-@ignore
-The internal @command{gettext} library tends to be problematic. It is therefore recommended
-to use either an external one (@option{--without-included-gettext}) or to disable
-NLS entirely (@option{--disable-nls}).
-@end ignore
-
-If you use GCC 2.95 it is recommended to use also:
-
-@example
-$ @kbd{LIBS="-lgcc"}
-$ @kbd{export LIBS}
-@end example
-
-You can also get an @code{a.out} executable if you prefer:
-
-@example
-$ @kbd{CFLAGS="-O2 -Zmt"}
-$ @kbd{export CFLAGS}
-$ @kbd{LDFLAGS="-s -Zstack 0x6000"}
-$ @kbd{LIBS="-lgcc"}
-$ @kbd{unset RANLIB}
-@c $ ./configure --prefix=c:/usr --without-included-gettext
-$ @kbd{./configure --prefix=c:/usr}
-$ @kbd{make}
-@end example
-
-@quotation NOTE
-Compilation of @code{a.out} executables also works with GCC 3.2.
-Versions later than GCC 3.2 have not been tested successfully.
-@end quotation
-
-@samp{make install} works as expected with the EMX build.
-
-@quotation NOTE
-Ancient OS/2 ports of GNU @command{make} are not able to handle
-the Makefiles of this package. If you encounter any problems with
-@command{make}, try GNU Make 3.79.1 or later versions. You should
-find the latest version on
-@uref{ftp://hobbes.nmsu.edu/pub/os2/}.@footnote{As of November 2014,
-this site is still there, but the author could not find a package
-for GNU Make.}
-@end quotation
-@end ifclear
-
-@node PC Testing
-@appendixsubsubsec Testing @command{gawk} on PC Operating Systems
-
-Using @command{make} to run the standard tests and to install @command{gawk}
-requires additional Unix-like tools, including @command{sh}, @command{sed}, and
-@command{cp}. In order to run the tests, the @file{test/*.ok} files may need to
-be converted so that they have the usual MS-DOS-style end-of-line markers.
-Alternatively, run @command{make check CMP="diff -a"} to use GNU @command{diff}
-in text mode instead of @command{cmp} to compare the resulting files.
-
-@ifclear FOR_PRINT
-Most
-of the tests work properly with Stewartson's shell along with the
-companion utilities or appropriate GNU utilities. However, some editing of
-@file{test/Makefile} is required. It is recommended that you copy the file
-@file{pc/Makefile.tst} over the file @file{test/Makefile} as a
-replacement. Details can be found in @file{README_d/README.pc}
-and in the file @file{pc/Makefile.tst}.
-
-On OS/2 the @code{pid} test fails because @code{spawnl()} is used instead of
-@code{fork()}/@code{execl()} to start child processes.
-Also the @code{mbfw1} and @code{mbprintf1} tests fail because the needed
-multibyte functionality is not available.
-@end ifclear
-
@node PC Using
@appendixsubsubsec Using @command{gawk} on PC Operating Systems
@cindex operating systems, PC, @command{gawk} on
@cindex PC operating systems, @command{gawk} on
-Under MS-DOS and MS-Windows, the Cygwin and MinGW environments support
+Under MS-Windows, the Cygwin and MinGW environments support
both the @samp{|&} operator and TCP/IP networking
(@pxref{TCP/IP Networking}).
-@ifclear FOR_PRINT
-EMX (OS/2 only) supports at least the @samp{|&} operator.
-@end ifclear
@cindex search paths
@cindex search paths, for source files
-@cindex @command{gawk}, MS-DOS version of
@cindex @command{gawk}, MS-Windows version of
@cindex @code{;} (semicolon), @env{AWKPATH} variable and
@cindex semicolon (@code{;}), @env{AWKPATH} variable and
@cindex @env{AWKPATH} environment variable
-The MS-DOS and MS-Windows versions of @command{gawk} search for
+The MS-Windows version of @command{gawk} searches for
program files as described in @ref{AWKPATH Variable}. However,
semicolons (rather than colons) separate elements in the @env{AWKPATH}
variable. If @env{AWKPATH} is not set or is empty, then the default
search path is @samp{@w{.;c:/lib/awk;c:/gnu/lib/awk}}.
-@ifclear FOR_PRINT
-@cindex @command{gawk}, OS/2 version of
-@cindex @code{UNIXROOT} variable, on OS/2 systems
-The search path for OS/2 (32 bit, EMX) is determined by the prefix directory
-(most likely @file{/usr} or @file{c:/usr}) that has been specified as an option of
-the @command{configure} script as is the case for the Unix versions.
-If @file{c:/usr} is the prefix directory then the default search path contains @file{.}
-and @file{c:/usr/share/awk}.
-Additionally, to support binary distributions of @command{gawk} for OS/2
-systems whose drive @samp{c:} might not support long @value{FN}s or might not exist
-at all, there is a special environment variable. If @env{UNIXROOT} specifies
-a drive then this specific drive is also searched for program files.
-E.g., if @env{UNIXROOT} is set to @file{e:} the complete default search path is
-@samp{@w{.;c:/usr/share/awk;e:/usr/share/awk}}.
-
-An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS
-or @command{cmd.exe} under MS-Windows or OS/2) may be useful for @command{awk} programming.
-The DJGPP collection of tools@footnote{Available from
-@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}.}
-includes an MS-DOS port of Bash,
-and several shells are available for OS/2, including @command{ksh}.
-@end ifclear
-@ifset FOR_PRINT
-An @command{sh}-like shell (as opposed to @command{command.com} under MS-DOS
-or @command{cmd.exe} under MS-Windows) may be useful for @command{awk} programming.
-The DJGPP collection of tools@footnote{Available from
-@uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/}.} includes an MS-DOS port of Bash.
-@end ifset
-
@cindex common extensions, @code{BINMODE} variable
@cindex extensions, common@comma{} @code{BINMODE} variable
@cindex differences in @command{awk} and @command{gawk}, @code{BINMODE} variable
@cindex @code{BINMODE} variable
-@ifclear FOR_PRINT
-Under MS-Windows, OS/2 and MS-DOS,
-@end ifclear
-@ifset FOR_PRINT
-Under MS-Windows and MS-DOS,
-@end ifset
+Under MS-Windows,
@command{gawk} (and many other text programs) silently
translates end-of-line @samp{\r\n} to @samp{\n} on input and @samp{\n}
to @samp{\r\n} on output. A special @code{BINMODE} variable @value{COMMONEXT}
@@ -38341,8 +38121,8 @@ The people maintaining the various @command{gawk} ports are:
@item MS-Windows with MinGW @tab Eli Zaretskii, @EMAIL{eliz@@gnu.org,eliz at gnu dot org}
-@c Leave this in the print version on purpose.
-@c OS/2 is not mentioned anywhere else in the print version though.
+@c Leave this in the document on purpose.
+@c OS/2 is not mentioned anywhere else though.
@item OS/2 @tab Andreas Buening, @EMAIL{andreas.buening@@nexgo.de,andreas dot buening at nexgo dot de}
@item VMS @tab John Malmberg, @EMAIL{wb8tyw@@qsl.net,wb8tyw at qsl.net}
@@ -38602,9 +38382,6 @@ cd gawk-@value{VERSION}.@value{PATCHLEVEL}
@command{gawk} may be built on non-POSIX systems as well. The currently
supported systems are MS-Windows using
MSYS, MinGW, and Cygwin,
-@ifclear FOR_PRINT
-OS/2 using EMX,
-@end ifclear
and both Vax/VMS and OpenVMS.
Instructions for each system are included in this @value{APPENDIX}.
@@ -42097,7 +41874,7 @@ Consistency issues:
Use @code{xxx} for the xxx operator in indexing statements, not @samp.
Use MS-Windows not MS Windows
- Use MS-DOS not MS-DOS
+ Use MS-DOS not MS DOS
Use an empty set of parentheses after built-in and awk function names.
Use "multiFOO" without a hyphen.
diff --git a/eval.c b/eval.c
index 90d0a035..e10bd3fc 100644
--- a/eval.c
+++ b/eval.c
@@ -1,23 +1,23 @@
/*
- * eval.c - gawk bytecode interpreter
+ * eval.c - gawk bytecode interpreter
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -53,7 +53,7 @@ static NODE *node_Boolean[2];
#ifdef C
#undef C
#endif
-#define C(c) ((char)c)
+#define C(c) ((char)c)
/*
* This table is used by the regexp routines to do case independent
* matching. Basically, every ascii character maps to itself, except
@@ -315,7 +315,7 @@ static struct optypetab {
{ "Op_match", " ~ " },
{ "Op_match_rec", NULL },
{ "Op_nomatch", " !~ " },
- { "Op_rule", NULL },
+ { "Op_rule", NULL },
{ "Op_K_case", "case" },
{ "Op_K_default", "default" },
{ "Op_K_break", "break" },
@@ -641,7 +641,7 @@ push_frame(NODE *f)
}
if (fcall_count > 1)
- memmove(fcall_list + 2, fcall_list + 1, (fcall_count - 1) * sizeof(NODE *));
+ memmove(fcall_list + 2, fcall_list + 1, (fcall_count - 1) * sizeof(NODE *));
fcall_list[1] = f;
}
@@ -652,7 +652,7 @@ static void
pop_frame()
{
if (fcall_count > 1)
- memmove(fcall_list + 1, fcall_list + 2, (fcall_count - 1) * sizeof(NODE *));
+ memmove(fcall_list + 1, fcall_list + 2, (fcall_count - 1) * sizeof(NODE *));
fcall_count--;
assert(fcall_count >= 0);
if (do_debug)
@@ -1076,7 +1076,7 @@ STACK_ITEM *stack_bottom;
STACK_ITEM *stack_top;
static unsigned long STACK_SIZE = 256; /* initial size of stack */
int max_args = 0; /* maximum # of arguments to printf, print, sprintf,
- * or # of array subscripts, or adjacent strings
+ * or # of array subscripts, or adjacent strings
* to be concatenated.
*/
NODE **args_array = NULL;
@@ -1148,7 +1148,7 @@ r_get_lhs(NODE *n, bool reference)
/* r_get_field --- get the address of a field node */
-
+
NODE **
r_get_field(NODE *n, Func_ptr *assign, bool reference)
{
@@ -1220,7 +1220,7 @@ calc_exp(AWKNUM x1, AWKNUM x2)
}
-/* setup_frame --- setup new frame for function call */
+/* setup_frame --- setup new frame for function call */
static INSTRUCTION *
setup_frame(INSTRUCTION *pc)
@@ -1262,7 +1262,7 @@ setup_frame(INSTRUCTION *pc)
}
- /* check for extra args */
+ /* check for extra args */
if (arg_count > pcount) {
warning(
_("function `%s' called with more arguments than declared"),
@@ -1361,7 +1361,7 @@ setup_frame(INSTRUCTION *pc)
/* setup new frame */
getnode(frame_ptr);
- frame_ptr->type = Node_frame;
+ frame_ptr->type = Node_frame;
frame_ptr->stack = sp;
frame_ptr->prev_frame_size = (stack_ptr - stack_bottom); /* size of the previous stack frame */
frame_ptr->func_node = f;
@@ -1479,7 +1479,7 @@ unwind_stack(long n)
if (in_main_context() && ! exiting)
fatal(_("unwind_stack: unexpected type `%s'"),
nodetype2str(r->type));
- /* else
+ /* else
* Node_var_array,
* Node_param_list,
* Node_var (e.g: trying to use scalar for array)
@@ -1493,7 +1493,7 @@ unwind_stack(long n)
break;
}
return cp;
-}
+}
/* pop_fcall --- pop off the innermost frame */
@@ -1541,7 +1541,7 @@ cmp_scalars(scalar_cmp_t comparison_type)
}
/* op_assign --- assignment operators excluding = */
-
+
static void
op_assign(OPCODE op)
{
@@ -1643,9 +1643,9 @@ POP_CODE()
typedef struct exec_state {
struct exec_state *next;
- INSTRUCTION *cptr; /* either getline (Op_K_getline) or the
+ INSTRUCTION *cptr; /* either getline (Op_K_getline) or the
* implicit "open-file, read-record" loop (Op_newfile).
- */
+ */
int rule; /* rule for the INSTRUCTION */
@@ -1711,7 +1711,7 @@ register_exec_hook(Func_pre_exec preh, Func_post_exec posth)
/*
* multiple post-exec hooks aren't supported. post-exec hook is mainly
* for use by the debugger.
- */
+ */
if (! preh || (post_execute && posth))
return false;
@@ -1739,7 +1739,7 @@ register_exec_hook(Func_pre_exec preh, Func_post_exec posth)
}
-/* interpreter routine when not debugging */
+/* interpreter routine when not debugging */
#include "interpret.h"
/* interpreter routine with exec hook(s). Used when debugging and/or with MPFR. */
@@ -1787,6 +1787,6 @@ init_interpret()
if (num_exec_hook > 0)
interpret = h_interpret;
else
- interpret = r_interpret;
+ interpret = r_interpret;
}
diff --git a/ext.c b/ext.c
index ce040ed7..10a42210 100644
--- a/ext.c
+++ b/ext.c
@@ -9,20 +9,20 @@
/*
* Copyright (C) 1995 - 2001, 2003-2014, 2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -120,15 +120,15 @@ make_builtin(const awk_ext_func_t *funcinfo)
/* user-defined function */
fatal(_("make_builtin: can't redefine function `%s'"), name);
} else if (f->type == Node_ext_func) {
- /* multiple extension() calls etc. */
+ /* multiple extension() calls etc. */
if (do_lint)
lintwarn(_("make_builtin: function `%s' already defined"), name);
return awk_false;
} else
- /* variable name etc. */
+ /* variable name etc. */
fatal(_("make_builtin: function name `%s' previously defined"), name);
} else if (check_special(name) >= 0)
- fatal(_("make_builtin: can't use gawk built-in `%s' as function name"), name);
+ fatal(_("make_builtin: can't use gawk built-in `%s' as function name"), name);
if (count < 0)
fatal(_("make_builtin: negative argument count for function `%s'"),
@@ -154,7 +154,7 @@ get_argument(int i)
NODE *t;
int arg_count;
INSTRUCTION *pc;
-
+
pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
arg_count = pc->expr_count; /* # of arguments supplied */
@@ -167,7 +167,7 @@ get_argument(int i)
if (t->type == Node_array_ref) {
if (t->orig_array->type == Node_var) {
- /* already a scalar, can no longer use it as array */
+ /* already a scalar, can no longer use it as array */
t->type = Node_var;
t->var_value = Nnull_string;
return t;
@@ -191,10 +191,10 @@ get_actual_argument(NODE *t, int i, bool want_array)
{
char *fname;
INSTRUCTION *pc;
-
+
pc = TOP()->code_ptr; /* Op_ext_builtin instruction */
fname = (pc + 1)->func_name;
-
+
if (t->type == Node_var_new) {
if (want_array)
return force_array(t, false);
@@ -239,7 +239,7 @@ close_extensions()
if (srcfiles == NULL)
return;
- for (s = srcfiles->next; s != srcfiles; s = s->next)
+ for (s = srcfiles->next; s != srcfiles; s = s->next)
if (s->stype == SRC_EXTLIB && s->fini_func)
(*s->fini_func)();
}
diff --git a/extension/ChangeLog b/extension/ChangeLog
index d179b8e4..52d4ddb5 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.4: Release tar ball made.
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 00387cf9..a074de53 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -12,20 +12,20 @@
/*
* Copyright (C) 2001, 2004, 2005, 2010-2016
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -484,7 +484,7 @@ do_stat(int nargs, awk_value_t *result)
warning(ext_id, _("stat: bad parameters"));
return make_number(-1, result);
}
-
+
if (nargs == 3) {
statfunc = stat;
}
@@ -561,7 +561,7 @@ do_statvfs(int nargs, awk_value_t *result)
#endif
array_set_numeric(array, "flag", vfsbuf.f_flag); /* mount flags */
array_set_numeric(array, "namemax", vfsbuf.f_namemax); /* maximum filename length */
-
+
return make_number(ret, result);
}
diff --git a/extension/fnmatch.c b/extension/fnmatch.c
index a85bcc78..f5fb02c6 100644
--- a/extension/fnmatch.c
+++ b/extension/fnmatch.c
@@ -8,20 +8,20 @@
/*
* Copyright (C) 2012, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/fork.c b/extension/fork.c
index 0ca0a0e0..82593b7f 100644
--- a/extension/fork.c
+++ b/extension/fork.c
@@ -7,20 +7,20 @@
/*
* Copyright (C) 2001, 2004, 2011, 2012, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/inplace.c b/extension/inplace.c
index c7eb5564..26c37922 100644
--- a/extension/inplace.c
+++ b/extension/inplace.c
@@ -4,20 +4,20 @@
/*
* Copyright (C) 2013-2015 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -132,7 +132,7 @@ do_inplace_begin(int nargs, awk_value_t *result)
if (nargs != 2)
fatal(ext_id, _("inplace_begin: expects 2 arguments but called with %d"), nargs);
-
+
if (! get_argument(0, AWK_STRING, &filename))
fatal(ext_id, _("inplace_begin: cannot retrieve 1st argument as a string filename"));
diff --git a/extension/ordchr.c b/extension/ordchr.c
index 8ec9de3f..4f9cd616 100644
--- a/extension/ordchr.c
+++ b/extension/ordchr.c
@@ -10,20 +10,20 @@
/*
* Copyright (C) 2001, 2004, 2011, 2012, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/readdir.c b/extension/readdir.c
index 4578b864..6106a44b 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -11,20 +11,20 @@
/*
* Copyright (C) 2012-2014 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/readfile.c b/extension/readfile.c
index 7673589f..fbe25748 100644
--- a/extension/readfile.c
+++ b/extension/readfile.c
@@ -14,20 +14,20 @@
/*
* Copyright (C) 2002, 2003, 2004, 2011, 2012, 2013, 2014
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/revoutput.c b/extension/revoutput.c
index 69257167..84d0aaa5 100644
--- a/extension/revoutput.c
+++ b/extension/revoutput.c
@@ -8,20 +8,20 @@
/*
* Copyright (C) 2012, 2013, 2015 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/revtwoway.c b/extension/revtwoway.c
index dfe58a1e..82fabb2b 100644
--- a/extension/revtwoway.c
+++ b/extension/revtwoway.c
@@ -8,20 +8,20 @@
/*
* Copyright (C) 2012-2014, 2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/rwarray.c b/extension/rwarray.c
index e751ea2c..15e121af 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -8,20 +8,20 @@
/*
* Copyright (C) 2009-2014 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -80,7 +80,7 @@ static awk_bool_t read_value(FILE *fp, awk_value_t *value);
* Minor version 4 bytes - network order
* Element count 4 bytes - network order
* Elements
- *
+ *
* For each element:
* Length of index val: 4 bytes - network order
* Index val as characters (N bytes)
@@ -436,7 +436,7 @@ read_value(FILE *fp, awk_value_t *value)
awk_array_t array = create_array();
if (! read_array(fp, array))
- return awk_false;
+ return awk_false;
/* hook into value */
value->val_type = AWK_ARRAY;
diff --git a/extension/rwarray0.c b/extension/rwarray0.c
index ec3663cc..00289cad 100644
--- a/extension/rwarray0.c
+++ b/extension/rwarray0.c
@@ -8,20 +8,20 @@
/*
* Copyright (C) 2009, 2010, 2011, 2012, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -76,7 +76,7 @@ static awk_bool_t read_value(int fd, awk_value_t *value);
* Minor version 4 bytes - network order
* Element count 4 bytes - network order
* Elements
- *
+ *
* For each element:
* Length of index val: 4 bytes - network order
* Index val as characters (N bytes)
@@ -431,7 +431,7 @@ read_value(int fd, awk_value_t *value)
awk_array_t array = create_array();
if (read_array(fd, array) != 0)
- return awk_false;
+ return awk_false;
/* hook into value */
value->val_type = AWK_ARRAY;
diff --git a/extension/stack.c b/extension/stack.c
index 6150442c..637378e2 100644
--- a/extension/stack.c
+++ b/extension/stack.c
@@ -2,22 +2,22 @@
* stack.c -- Implementation for stack functions for use by extensions.
*/
-/*
+/*
* Copyright (C) 2012, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/extension/testext.c b/extension/testext.c
index e2ddbe87..9216d64a 100644
--- a/extension/testext.c
+++ b/extension/testext.c
@@ -5,20 +5,20 @@
/*
* Copyright (C) 2012, 2013, 2014, 2015
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -918,22 +918,22 @@ do_get_file(int nargs, awk_value_t *result)
if (ibuf) {
awk_value_t idx, val;
- set_array_element(res.array_cookie,
+ set_array_element(res.array_cookie,
make_const_string("input", 5, & idx),
make_number(ibuf->fd, & val));
if (ibuf->name)
- set_array_element(res.array_cookie,
+ set_array_element(res.array_cookie,
make_const_string("input_name", 10, & idx),
make_const_string(ibuf->name, strlen(ibuf->name), & val));
}
if (obuf) {
awk_value_t idx, val;
- set_array_element(res.array_cookie,
+ set_array_element(res.array_cookie,
make_const_string("output", 6, & idx),
make_number(obuf->fp ? fileno(obuf->fp) : -1,
& val));
if (obuf->name)
- set_array_element(res.array_cookie,
+ set_array_element(res.array_cookie,
make_const_string("output_name", 11, & idx),
make_const_string(obuf->name, strlen(obuf->name), & val));
}
diff --git a/field.c b/field.c
index 892818f7..4f24d5f3 100644
--- a/field.c
+++ b/field.c
@@ -2,22 +2,22 @@
* field.c - routines for dealing with fields and record parsing
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -276,7 +276,7 @@ set_record(const char *buf, int cnt)
memcpy(databuf, buf, cnt);
/*
- * Add terminating '\0' so that C library routines
+ * Add terminating '\0' so that C library routines
* will know when to stop.
*/
databuf[cnt] = '\0';
@@ -339,7 +339,7 @@ set_NF()
assert(NF != -1);
(void) force_number(NF_node->var_value);
- nf = get_number_si(NF_node->var_value);
+ nf = get_number_si(NF_node->var_value);
if (nf < 0)
fatal(_("NF set to negative value"));
NF = nf;
@@ -407,7 +407,7 @@ re_parse_field(long up_to, /* parse only up to this field number */
sep = scan;
while (scan < end && (*scan == ' ' || *scan == '\t' || *scan == '\n'))
scan++;
- if (sep_arr != NULL && sep < scan)
+ if (sep_arr != NULL && sep < scan)
set_element(nf, sep, (long)(scan - sep), sep_arr);
}
@@ -439,8 +439,8 @@ re_parse_field(long up_to, /* parse only up to this field number */
}
(*set)(++nf, field,
(long)(scan + RESTART(rp, scan) - field), n);
- if (sep_arr != NULL)
- set_element(nf, scan + RESTART(rp, scan),
+ if (sep_arr != NULL)
+ set_element(nf, scan + RESTART(rp, scan),
(long) (REEND(rp, scan) - RESTART(rp, scan)), sep_arr);
scan += REEND(rp, scan);
field = scan;
@@ -504,7 +504,7 @@ def_parse_field(long up_to, /* parse only up to this field number */
sep = scan;
for (; nf < up_to; scan++) {
/*
- * special case: fs is single space, strip leading whitespace
+ * special case: fs is single space, strip leading whitespace
*/
while (scan < end && (*scan == ' ' || *scan == '\t' || *scan == '\n'))
scan++;
@@ -786,11 +786,11 @@ get_field(long requested, Func_ptr *assign)
/*
* Keep things uniform. Also, mere intention of assigning something
* to $n should not make $0 invalid. Makes sense to invalidate $0
- * after the actual assignment is performed. Not a real issue in
+ * after the actual assignment is performed. Not a real issue in
* the interpreter otherwise, but causes problem in the
* debugger when watching or printing fields.
*/
-
+
if (assign != NULL)
*assign = invalidate_field0; /* $0 needs reconstruction */
#endif
@@ -906,12 +906,12 @@ do_split(int nargs)
if (sep_arr != NULL) {
if (sep_arr == arr)
- fatal(_("split: cannot use the same array for second and fourth args"));
+ fatal(_("split: cannot use the same array for second and fourth args"));
/* This checks need to be done before clearing any of the arrays */
for (tmp = sep_arr->parent_array; tmp != NULL; tmp = tmp->parent_array)
if (tmp == arr)
- fatal(_("split: cannot use a subarray of second arg for fourth arg"));
+ fatal(_("split: cannot use a subarray of second arg for fourth arg"));
for (tmp = arr->parent_array; tmp != NULL; tmp = tmp->parent_array)
if (tmp == sep_arr)
fatal(_("split: cannot use a subarray of fourth arg for second arg"));
@@ -997,7 +997,7 @@ do_patsplit(int nargs)
if (sep_arr != NULL) {
if (sep_arr == arr)
- fatal(_("patsplit: cannot use the same array for second and fourth args"));
+ fatal(_("patsplit: cannot use the same array for second and fourth args"));
/* These checks need to be done before clearing any of the arrays */
for (tmp = sep_arr->parent_array; tmp != NULL; tmp = tmp->parent_array)
@@ -1091,7 +1091,7 @@ set_FIELDWIDTHS()
|| (*end != '\0' && ! is_blank(*end))
|| !(0 < tmp && tmp <= INT_MAX)
) {
- fatal_error = true;
+ fatal_error = true;
break;
}
FIELDWIDTHS[i] = tmp;
@@ -1162,7 +1162,7 @@ set_FS()
* FS_regexp will be NULL with a non-null FS_re_yes_case.
* refree() handles null argument; no need for `if (FS_regexp != NULL)' below.
* Please do not remerge.
- */
+ */
refree(FS_re_yes_case);
refree(FS_re_no_case);
FS_re_yes_case = FS_re_no_case = FS_regexp = NULL;
@@ -1405,19 +1405,19 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* BEGIN {
* false = 0
* true = 1
- *
+ *
* fpat[1] = "([^,]*)|(\"[^\"]+\")"
* fpat[2] = fpat[1]
* fpat[3] = fpat[1]
* fpat[4] = "aa+"
* fpat[5] = fpat[4]
- *
+ *
* data[1] = "Robbins,,Arnold,"
* data[2] = "Smith,,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA"
* data[3] = "Robbins,Arnold,\"1234 A Pretty Place, NE\",Sometown,NY,12345-6789,USA"
* data[4] = "bbbaaacccdddaaaaaqqqq"
* data[5] = "bbbaaacccdddaaaaaqqqqa" # should get trailing qqqa
- *
+ *
* for (i = 1; i in data; i++) {
* printf("Splitting: <%s>\n", data[i])
* n = mypatsplit(data[i], fields, fpat[i], seps)
@@ -1428,7 +1428,7 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* printf("seps[%s] = <%s>\n", j, seps[j])
* }
* }
- *
+ *
* function mypatsplit(string, array, pattern, seps,
* eosflag, non_empty, nf) # locals
* {
@@ -1436,7 +1436,7 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* delete seps
* if (length(string) == 0)
* return 0
- *
+ *
* eosflag = non_empty = false
* nf = 0
* while (match(string, pattern)) {
@@ -1487,7 +1487,7 @@ incr_scan(char **scanp, size_t len, mbstate_t *mbs)
* }
* if (length(string) > 0)
* seps[nf] = string
- *
+ *
* return length(array)
* }
*/
@@ -1560,7 +1560,7 @@ fpat_parse_field(long up_to, /* parse only up to this field number */
* last match was non-empty, and at the
* current character we get a zero length match,
* which we don't want, so skip over it
- */
+ */
non_empty = false;
if (sep_arr != NULL) {
need_to_set_sep = false;
diff --git a/floatcomp.c b/floatcomp.c
index 9ba169a4..7317fa75 100644
--- a/floatcomp.c
+++ b/floatcomp.c
@@ -2,23 +2,23 @@
* floatcomp.c - Isolate floating point details.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2011, 2016
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/floatmagic.h b/floatmagic.h
index c6aabd92..cb22b611 100644
--- a/floatmagic.h
+++ b/floatmagic.h
@@ -1,23 +1,23 @@
/*
- * floatmagic.h -- Definitions of isnan and isinf for gawk.
+ * floatmagic.h -- Definitions of isnan and isinf for gawk.
*/
-/*
+/*
* Copyright (C) 2009 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/gawkapi.c b/gawkapi.c
index df69012b..ba881a3c 100644
--- a/gawkapi.c
+++ b/gawkapi.c
@@ -2,22 +2,22 @@
* gawkapi.c -- Implement the functions defined for gawkapi.h
*/
-/*
+/*
* Copyright (C) 2012-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -76,7 +76,7 @@ api_get_argument(awk_ext_id_t id, size_t count,
goto scalar;
}
}
-
+
/* at this point, we have real type */
if (arg->type == Node_var_array || arg->type == Node_array_ref) {
if (wanted != AWK_ARRAY && wanted != AWK_UNDEFINED)
@@ -502,7 +502,7 @@ node_to_awk_value(NODE *node, awk_value_t *val, awk_valtype_t wanted)
* - No access to special variables (NF, etc.)
* - One special exception: PROCINFO.
* - Use sym_update() to change a value, including from UNDEFINED
- * to scalar or array.
+ * to scalar or array.
*/
/*
* Lookup a variable, fills in value. No messing with the value
@@ -814,7 +814,7 @@ api_set_array_element(awk_ext_id_t id, awk_array_t a_cookie,
}
/*
- * remove_element --- remove an array element
+ * remove_element --- remove an array element
* common code used by multiple functions
*/
diff --git a/gawkapi.h b/gawkapi.h
index 975f82df..7482af51 100644
--- a/gawkapi.h
+++ b/gawkapi.h
@@ -2,22 +2,22 @@
* gawkapi.h -- Definitions for use by extension functions calling into gawk.
*/
-/*
+/*
* Copyright (C) 2012-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -53,7 +53,7 @@
* This API purposely restricts itself to ISO C 90 features. In particular, no
* bool, no // comments, no use of the restrict keyword, or anything else,
* in order to provide maximal portability.
- *
+ *
* Exception: the "inline" keyword is used below in the "constructor"
* functions. If your compiler doesn't support it, you should either
* -Dinline='' on your command line, or use the autotools and include a
@@ -136,7 +136,7 @@ typedef struct awk_input {
* parser is responsible for managing its own memory buffer.
* Similarly, gawk will make its own copy of RT, so the parser
* is also responsible for managing this memory.
- *
+ *
* It is guaranteed that errcode is a valid pointer, so there is
* no need to test for a NULL value. Gawk sets *errcode to 0,
* so there is no need to set it unless an error occurs.
@@ -165,7 +165,7 @@ typedef struct awk_input {
/* put last, for alignment. bleah */
struct stat sbuf; /* stat buf */
-
+
} awk_input_buf_t;
typedef struct awk_input_parser {
@@ -531,7 +531,7 @@ typedef struct gawk_api {
* - Read-only access to special variables (NF, etc.)
* - One special exception: PROCINFO.
* - Use sym_update() to change a value, including from UNDEFINED
- * to scalar or array.
+ * to scalar or array.
*/
/*
* Lookup a variable, fill in value. No messing with the value
@@ -692,7 +692,7 @@ typedef struct gawk_api {
* Look up a file. If the name is NULL or name_len is 0, it returns
* data for the currently open input file corresponding to FILENAME
* (and it will not access the filetype argument, so that may be
- * undefined).
+ * undefined).
* If the file is not already open, it tries to open it.
* The "filetype" argument should be one of:
* ">", ">>", "<", "|>", "|<", and "|&"
diff --git a/gawkmisc.c b/gawkmisc.c
index 0172a810..f1658921 100644
--- a/gawkmisc.c
+++ b/gawkmisc.c
@@ -2,23 +2,23 @@
* gawkmisc.c --- miscellanious gawk routines that are OS specific.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2004, 2010, 2011
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/helpers/ChangeLog b/helpers/ChangeLog
index 47062233..d29071e3 100644
--- a/helpers/ChangeLog
+++ b/helpers/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-09-08 Paul Eggert <eggert@cs.ucla.edu>
* testdfa.c: Adjust to DFA API changes.
diff --git a/helpers/testdfa.c b/helpers/testdfa.c
index fa7715f9..72b97907 100644
--- a/helpers/testdfa.c
+++ b/helpers/testdfa.c
@@ -2,22 +2,22 @@
* testdfa.c --- abstracted from gawk.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -395,7 +395,7 @@ setup_pattern(const char *pattern, size_t *len)
/*
* Build a copy of the string (in buf) with the
* escaped characters translated, and generate the regex
- * from that.
+ * from that.
*/
buf = (char *) malloc(*len + 1);
if (buf == NULL) {
@@ -499,16 +499,16 @@ setup_pattern(const char *pattern, size_t *len)
*
* Parse a C escape sequence. STRING_PTR points to a variable containing a
* pointer to the string to parse. That pointer is updated past the
- * characters we use. The value of the escape sequence is returned.
+ * characters we use. The value of the escape sequence is returned.
*
* A negative value means the sequence \ newline was seen, which is supposed to
- * be equivalent to nothing at all.
+ * be equivalent to nothing at all.
*
* If \ is followed by a null character, we return a negative value and leave
- * the string pointer pointing at the null character.
+ * the string pointer pointing at the null character.
*
* If \ is followed by 000, we return 0 and leave the string pointer after the
- * zeros. A value of 0 does not mean end of string.
+ * zeros. A value of 0 does not mean end of string.
*
* POSIX doesn't allow \x.
*/
@@ -597,7 +597,7 @@ parse_escape(const char **string_ptr)
#ifdef C
#undef C
#endif
-#define C(c) ((char)c)
+#define C(c) ((char)c)
/*
* This table is used by the regexp routines to do case independent
* matching. Basically, every ascii character maps to itself, except
diff --git a/helpers/testnet.c b/helpers/testnet.c
index feda38b4..cbe2d97e 100644
--- a/helpers/testnet.c
+++ b/helpers/testnet.c
@@ -220,9 +220,9 @@ devopen(const char *name, const char *mode)
localpname = cp;
while (*cp != '/' && *cp != '\0')
cp++;
- /*
+ /*
* Require a port, let them explicitly put 0 if
- * they don't care.
+ * they don't care.
*/
if (*cp != '/' || cp == localpname) {
fprintf(stderr, _("special file name `%s' is incomplete"), name);
@@ -241,7 +241,7 @@ devopen(const char *name, const char *mode)
cp++;
hostname = cp;
while (*cp != '/' && *cp != '\0')
- cp++;
+ cp++;
if (*cp != '/' || cp == hostname) {
*localpnamelastcharp = '/';
fprintf(stderr, _("must supply a remote hostname to `/inet'"));
@@ -278,7 +278,7 @@ devopen(const char *name, const char *mode)
char *cp, *end;
unsigned long count = 0;
char *ms2;
-
+
first_time = false;
if ((cp = getenv("GAWK_SOCK_RETRIES")) != NULL) {
count = strtoul(cp, & end, 10);
diff --git a/int_array.c b/int_array.c
index c244169f..2ab68eeb 100644
--- a/int_array.c
+++ b/int_array.c
@@ -2,23 +2,23 @@
* int_array.c - routines for arrays of integer indices.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2013, 2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -175,7 +175,7 @@ is_integer(NODE *symbol, NODE *subs)
if (len == 0 || (! isdigit((unsigned char) *cp) && *cp != '-'))
return NULL;
- if (len > 1 &&
+ if (len > 1 &&
((*cp == '0') /* "00", "011" .. */
|| (*cp == '-' && *(cp + 1) == '0') /* "-0", "-011" .. */
)
@@ -240,7 +240,7 @@ int_lookup(NODE *symbol, NODE *subs)
if (! is_integer(symbol, subs)) {
- xn = symbol->xarray;
+ xn = symbol->xarray;
if (xn == NULL) {
xn = symbol->xarray = make_array();
xn->vname = symbol->vname; /* shallow copy */
@@ -258,9 +258,9 @@ int_lookup(NODE *symbol, NODE *subs)
hash1 = int_hash(k, symbol->array_size);
if ((lhs = int_find(symbol, k, hash1)) != NULL)
return lhs;
-
+
/* It's not there, install it */
-
+
symbol->table_size++;
/* first see if we would need to grow the array, before installing */
@@ -274,7 +274,7 @@ int_lookup(NODE *symbol, NODE *subs)
/* have to recompute hash value for new size */
hash1 = int_hash(k, symbol->array_size);
}
-
+
return int_insert(symbol, k, hash1);
}
@@ -328,7 +328,7 @@ int_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
r = b->aivalue[j];
if (r->type == Node_var_array) {
assoc_clear(r); /* recursively clear all sub-arrays */
- efree(r->vname);
+ efree(r->vname);
freenode(r);
} else
unref(r);
@@ -454,7 +454,7 @@ int_copy(NODE *symbol, NODE *newsymb)
/* find the current hash size */
cursize = symbol->array_size;
-
+
/* allocate new table */
emalloc(new, BUCKET **, cursize * sizeof(BUCKET *), "int_copy");
memset(new, '\0', cursize * sizeof(BUCKET *));
@@ -493,7 +493,7 @@ int_copy(NODE *symbol, NODE *newsymb)
newchain->ainext = NULL;
pnew = & newchain->ainext;
}
- }
+ }
if (symbol->xarray != NULL) {
NODE *xn, *n;
@@ -539,7 +539,7 @@ int_list(NODE *symbol, NODE *t)
if ((assoc_kind & (AINDEX|AVALUE)) == (AINDEX|AVALUE))
elem_size = 2;
list_size = elem_size * num_elems;
-
+
if (symbol->xarray != NULL) {
xn = symbol->xarray;
list = xn->alist(xn, t);
@@ -559,7 +559,7 @@ int_list(NODE *symbol, NODE *t)
/* index */
num = b->ainum[j];
if ((assoc_kind & AISTR) != 0) {
- sprintf(buf, "%ld", num);
+ sprintf(buf, "%ld", num);
subs = make_string(buf, strlen(buf));
subs->numbr = num;
subs->flags |= (NUMCUR|NUMINT);
@@ -604,7 +604,7 @@ int_kilobytes(NODE *symbol)
for (b = symbol->buckets[i]; b != NULL; b = b->ainext)
bucket_cnt++;
}
- kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
+ kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
((AWKNUM) symbol->array_size) * sizeof (BUCKET *)) / 1024.0;
if (symbol->xarray != NULL)
@@ -738,7 +738,7 @@ int_hash(uint32_t k, uint32_t hsize)
*/
/* This is the final mixing function used by Paul Hsieh in SuperFastHash. */
-
+
k ^= k << 3;
k += k >> 5;
k ^= k << 4;
@@ -780,7 +780,7 @@ int_insert(NODE *symbol, long k, uint32_t hash1)
b = symbol->buckets[hash1];
- /* Only the first bucket in the chain can be partially full, but is never empty. */
+ /* Only the first bucket in the chain can be partially full, but is never empty. */
if (b == NULL || (i = b->aicount) == 2) {
getbucket(b);
@@ -820,7 +820,7 @@ grow_int_table(NODE *symbol)
static const unsigned long sizes[] = {
13, 127, 1021, 8191, 16381, 32749, 65497,
131101, 262147, 524309, 1048583, 2097169,
- 4194319, 8388617, 16777259, 33554467,
+ 4194319, 8388617, 16777259, 33554467,
67108879, 134217757, 268435459, 536870923,
1073741827
};
diff --git a/interpret.h b/interpret.h
index 135f4e58..9d3c1087 100644
--- a/interpret.h
+++ b/interpret.h
@@ -2,22 +2,22 @@
* interpret.h --- run a list of instructions.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -99,7 +99,7 @@ top:
/* avoid false source indications */
source = NULL;
sourceline = 0;
- (void) nextfile(& curfile, true); /* close input data file */
+ (void) nextfile(& curfile, true); /* close input data file */
/*
* This used to be:
*
@@ -161,7 +161,7 @@ top:
m = m->orig_array;
}
}
-
+
switch (m->type) {
case Node_var:
if (do_lint && var_uninitialized(m))
@@ -203,7 +203,7 @@ uninitialized_scalar:
cant_happen();
}
}
- break;
+ break;
case Op_push_param: /* function argument */
m = pc->memory;
@@ -241,7 +241,7 @@ uninitialized_scalar:
/* for FUNCTAB, get the name as the element value */
if (t1 == func_table) {
static bool warned = false;
-
+
if (do_lint && ! warned) {
warned = true;
lintwarn(_("FUNCTAB is a gawk extension"));
@@ -259,7 +259,7 @@ uninitialized_scalar:
/* for SYMTAB, step through to the actual variable */
if (t1 == symbol_table) {
static bool warned = false;
-
+
if (do_lint && ! warned) {
warned = true;
lintwarn(_("SYMTAB is a gawk extension"));
@@ -304,7 +304,7 @@ uninitialized_scalar:
t1 = POP_ARRAY();
if (do_lint && in_array(t1, t2) == NULL) {
t2 = force_string(t2);
- if (pc->do_reference)
+ if (pc->do_reference)
lintwarn(_("reference to uninitialized element `%s[\"%.*s\"]'"),
array_vname(t1), (int) t2->stlen, t2->stptr);
if (t2->stlen == 0)
@@ -408,7 +408,7 @@ uninitialized_scalar:
case Op_jmp_true:
r = POP_SCALAR();
di = eval_condition(r);
- DEREF(r);
+ DEREF(r);
if (di)
JUMPTO(pc->target_jmp);
break;
@@ -499,7 +499,7 @@ plus:
case Op_minus:
t2 = POP_NUMBER();
x2 = t2->numbr;
- DEREF(t2);
+ DEREF(t2);
minus:
t1 = TOP_NUMBER();
r = make_number(t1->numbr - x2);
@@ -549,7 +549,7 @@ quotient:
r = make_number(t1->numbr / x2);
DEREF(t1);
REPLACE(r);
- break;
+ break;
case Op_mod_i:
x2 = force_number(pc->memory)->numbr;
@@ -673,7 +673,7 @@ mod:
* simple variable assignment optimization,
* see awkgram.y (optimize_assignment)
*/
-
+
lhs = get_lhs(pc->memory, false);
unref(*lhs);
r = pc->initval; /* constant initializer */
@@ -737,7 +737,7 @@ mod:
} else
free_wstr(*lhs);
} else {
- size_t nlen = t1->stlen + t2->stlen;
+ size_t nlen = t1->stlen + t2->stlen;
char *p;
emalloc(p, char *, nlen + 1, "r_interpret");
@@ -745,7 +745,7 @@ mod:
memcpy(p + t1->stlen, t2->stptr, t2->stlen);
/* N.B. No NUL-termination required, since make_str_node will do it. */
unref(*lhs);
- t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
+ t1 = *lhs = make_str_node(p, nlen, ALREADY_MALLOCED);
}
DEREF(t2);
break;
@@ -760,7 +760,7 @@ mod:
break;
case Op_subscript_assign:
- /* conditionally execute post-assignment routine for an array element */
+ /* conditionally execute post-assignment routine for an array element */
if (set_idx != NULL) {
di = true;
@@ -996,7 +996,7 @@ arrayfor:
}
PUSH(m);
break;
-
+
case Op_match_rec:
m = pc->memory;
t1 = *get_field(0, (Func_ptr *) 0);
@@ -1057,7 +1057,7 @@ match_re:
} else if (f->type == Node_builtin_func) {
int arg_count = (pc + 1)->expr_count;
builtin_func_t the_func = lookup_builtin(t1->stptr);
-
+
assert(the_func != NULL);
/* call it */
@@ -1090,11 +1090,11 @@ match_re:
npc[1] = pc[1];
npc[1].func_name = fname; /* name of the builtin */
npc[1].expr_count = bc->expr_count; /* defined max # of arguments */
- ni = npc;
+ ni = npc;
JUMPTO(ni);
} else
fatal(_("function called indirectly through `%s' does not exist"),
- pc->func_name);
+ pc->func_name);
}
pc->func_body = f; /* save for next call */
@@ -1128,7 +1128,7 @@ match_re:
pc->expr_count = arg_count; /* actual argument count */
(pc + 1)->func_name = fname; /* name of the builtin */
(pc + 1)->expr_count = bc->expr_count; /* defined max # of arguments */
- ni = pc;
+ ni = pc;
JUMPTO(ni);
}
@@ -1140,7 +1140,7 @@ match_re:
m = POP_SCALAR(); /* return value */
ni = pop_fcall();
-
+
/* put the return value back on stack */
PUSH(m);
@@ -1165,7 +1165,7 @@ match_re:
/* Save execution state so that we can return to it
* from Op_after_beginfile or Op_after_endfile.
- */
+ */
push_exec_state(pc, currule, source, stack_ptr);
@@ -1223,8 +1223,8 @@ match_re:
execute beginfile block */
}
break;
-
- case Op_get_record:
+
+ case Op_get_record:
{
int errcode = 0;
@@ -1282,13 +1282,13 @@ match_re:
JUMPTO(ni);
} else {
/* do run ENDFILE block(s) first. */
-
+
/* Execution state to return to in Op_after_endfile. */
push_exec_state(ni, currule, source, stack_ptr);
JUMPTO(pc->target_endfile);
- }
- } /* else
+ }
+ } /* else
Start over with the first rule. */
/* empty the run-time stack to avoid memory leak */
@@ -1379,7 +1379,7 @@ match_re:
/* not already triggered and left expression is true */
decr_sp();
ip->triggered = true;
- JUMPTO(ip->target_jmp); /* evaluate right expression */
+ JUMPTO(ip->target_jmp); /* evaluate right expression */
}
result = ip->triggered || di;
diff --git a/io.c b/io.c
index 42986091..761520e3 100644
--- a/io.c
+++ b/io.c
@@ -2,23 +2,23 @@
* io.c --- routines for dealing with input and output and records
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -357,7 +357,7 @@ init_io()
* PROCINFO entries for timeout are dynamic;
* We can't be any more specific than this.
*/
- if (PROCINFO_node != NULL)
+ if (PROCINFO_node != NULL)
read_can_timeout = true;
}
@@ -417,7 +417,7 @@ after_beginfile(IOBUF **curfile)
bool valid;
fname = iop->public.name;
- errcode = iop->errcode;
+ errcode = iop->errcode;
valid = iop->valid;
errno = 0;
update_ERRNO_int(errcode);
@@ -466,12 +466,12 @@ nextfile(IOBUF **curfile, bool skipping)
(void) iop_close(iop);
*curfile = NULL;
return 1; /* run endfile block */
- } else
+ } else
return 0;
}
argc = get_number_si(ARGC_node->var_value);
-
+
for (; i < argc; i++) {
tmp = make_number((AWKNUM) i);
(void) force_string(tmp);
@@ -597,7 +597,7 @@ inrec(IOBUF *iop, int *errcode)
cnt = EOF;
else if ((iop->flag & IOP_CLOSED) != 0)
cnt = EOF;
- else
+ else
cnt = get_a_record(& begin, iop, errcode);
/* Note that get_a_record may return -2 when I/O would block */
@@ -1022,7 +1022,7 @@ redirect_string(const char *str, size_t explen, bool not_string,
#ifdef VMS
/* Alpha/VMS V7.1+ C RTL is returning these instead
of EMFILE (haven't tried other post-V6.2 systems) */
- else if ((errno == EIO || errno == EVMSERR) &&
+ else if ((errno == EIO || errno == EVMSERR) &&
(vaxc$errno == SS$_EXQUOTA ||
vaxc$errno == SS$_EXBYTLM ||
vaxc$errno == RMS$_ACC ||
@@ -1168,7 +1168,7 @@ close_one()
}
if (rp == NULL)
/* surely this is the only reason ??? */
- fatal(_("too many pipes or input files open"));
+ fatal(_("too many pipes or input files open"));
}
/* do_close --- completely close an open file or pipe */
@@ -1747,7 +1747,7 @@ devopen(const char *name, const char *mode)
char *cp, *end;
unsigned long count = 0;
char *ms2;
-
+
first_time = false;
if ((cp = getenv("GAWK_SOCK_RETRIES")) != NULL) {
count = strtoul(cp, & end, 10);
@@ -1886,7 +1886,7 @@ two_way_open(const char *str, struct redirect *rp, int extfd)
char c;
int master, dup_master;
int slave;
- int save_errno;
+ int save_errno;
pid_t pid;
struct stat statb;
struct termios st;
@@ -2141,7 +2141,7 @@ use_pipes:
#if defined(__EMX__) || defined(__MINGW32__)
save_stdin = dup(0); /* duplicate stdin */
save_stdout = dup(1); /* duplicate stdout */
-
+
if (save_stdout == -1 || save_stdin == -1) {
/* if an error occurs close all open file handles */
save_errno = errno;
@@ -2154,7 +2154,7 @@ use_pipes:
errno = save_errno;
return false;
}
-
+
/* connect pipes to stdin and stdout */
close(1); /* close stdout */
if (dup(ctop[1]) != 1) { /* connect pipe input to stdout */
@@ -2174,7 +2174,7 @@ use_pipes:
/* none of these handles must be inherited by the child process */
(void) close(ptoc[0]); /* close pipe output, child will use stdin instead */
(void) close(ctop[1]); /* close pipe input, child will use stdout instead */
-
+
os_close_on_exec(ptoc[1], str, "pipe", "from"); /* pipe input: output of the parent process */
os_close_on_exec(ctop[0], str, "pipe", "from"); /* pipe output: input of the parent process */
os_close_on_exec(save_stdin, str, "pipe", "from"); /* saved stdin of the parent process */
@@ -2188,7 +2188,7 @@ use_pipes:
qcmd = quote_cmd(str), NULL);
efree(qcmd);
#endif
-
+
/* restore stdin and stdout */
close(1);
if (dup(save_stdout) != 1) {
@@ -2197,7 +2197,7 @@ use_pipes:
fatal(_("restoring stdout in parent process failed\n"));
}
close(save_stdout);
-
+
close(0);
if (dup(save_stdin) != 0) {
close(save_stdin);
@@ -2223,7 +2223,7 @@ use_pipes:
errno = save_errno;
return false;
}
-
+
if (pid == 0) { /* child */
if (close(1) == -1)
fatal(_("close of stdout in child failed (%s)"),
@@ -2444,10 +2444,10 @@ gawk_popen(const char *cmd, struct redirect *rp)
fatal(_("moving pipe to stdout in child failed (dup: %s)"),
strerror(errno));
}
-
+
/* none of these handles must be inherited by the child process */
close(p[1]); /* close pipe input */
-
+
os_close_on_exec(p[0], cmd, "pipe", "from"); /* pipe output: input of the parent process */
os_close_on_exec(save_stdout, cmd, "pipe", "from"); /* saved stdout of the parent process */
@@ -2458,7 +2458,7 @@ gawk_popen(const char *cmd, struct redirect *rp)
qcmd = quote_cmd(cmd), NULL);
efree(qcmd);
#endif
-
+
/* restore stdout */
close(1);
if (dup(save_stdout) != 1) {
@@ -2686,7 +2686,7 @@ do_getline(int into_variable, IOBUF *iop)
update_ERRNO_int(errcode);
if (into_variable)
(void) POP_ADDRESS();
- return make_number((AWKNUM) cnt);
+ return make_number((AWKNUM) cnt);
}
if (cnt == EOF)
@@ -2709,8 +2709,8 @@ do_getline(int into_variable, IOBUF *iop)
typedef struct {
const char *envname;
char **dfltp; /* pointer to address of default path */
- char **awkpath; /* array containing library search paths */
- int max_pathlen; /* length of the longest item in awkpath */
+ char **awkpath; /* array containing library search paths */
+ int max_pathlen; /* length of the longest item in awkpath */
} path_info;
static path_info pi_awkpath = {
@@ -2779,7 +2779,7 @@ init_awkpath(path_info *pi)
#undef INC_PATH
}
-/* do_find_source --- search $AWKPATH for file, return NULL if not found */
+/* do_find_source --- search $AWKPATH for file, return NULL if not found */
static char *
do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi)
@@ -2803,7 +2803,7 @@ do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi)
if (pi->awkpath == NULL)
init_awkpath(pi);
- emalloc(path, char *, pi->max_pathlen + strlen(src) + 1, "do_find_source");
+ emalloc(path, char *, pi->max_pathlen + strlen(src) + 1, "do_find_source");
for (i = 0; pi->awkpath[i] != NULL; i++) {
if (strcmp(pi->awkpath[i], "./") == 0 || strcmp(pi->awkpath[i], ".") == 0)
*path = '\0';
@@ -2820,7 +2820,7 @@ do_find_source(const char *src, struct stat *stb, int *errcode, path_info *pi)
return NULL;
}
-/* find_source --- find source file with default file extension handling */
+/* find_source --- find source file with default file extension handling */
char *
find_source(const char *src, struct stat *stb, int *errcode, int is_extlib)
@@ -3288,51 +3288,51 @@ rs1scan(IOBUF *iop, struct recmatch *recm, SCANSTATE *state)
* Subject: Re: multibyte locales: any way to find if a character isn't multibyte?
* Date: Mon, 23 Jun 2003 12:20:16 +0200
* Cc: isamu@yamato.ibm.com
- *
+ *
* Hi,
- *
+ *
* > Is there any way to make the following query to the current locale?
* >
* > Given an 8-bit value, can this value ever appear as part of
* > a multibyte character?
- *
+ *
* There is no simple answer here. The easiest solution I see is to
* get the current locale's codeset (via locale_charset() which is a
* wrapper around nl_langinfo(CODESET)), and then perform a case-by-case
* treatment of the known multibyte encodings, from GB2312 to EUC-JISX0213;
* for the unibyte encodings, a single btowc() call will tell you.
- *
+ *
* > This is particularly critical for me for ASCII newline ('\n'). If I
* > can be guaranteed that it never shows up as part of a multibyte character,
* > I can speed up gawk considerably in mulitbyte locales.
- *
+ *
* This is much simpler to answer!
* In all ASCII based multibyte encodings used for locales today (this
* excludes EBCDIC based doublebyte encodings from IBM, and also excludes
* ISO-2022-JP which is used for email exchange but not as a locale encoding)
* ALL bytes in the range 0x00..0x2F occur only as a single character, not
* as part of a multibyte character.
- *
+ *
* So it's safe to assume, but deserves a comment in the source.
- *
+ *
* Bruno
***************************************************************
* From: Bruno Haible <bruno@clisp.org>
* To: Aharon Robbins <arnold@skeeve.com>
* Subject: Re: multibyte locales: any way to find if a character isn't multibyte?
* Date: Mon, 23 Jun 2003 14:27:49 +0200
- *
+ *
* On Monday 23 June 2003 14:11, you wrote:
- *
+ *
* > if (rs != '\n' && MB_CUR_MAX > 1) {
- *
+ *
* If you assume ASCII, you can even write
- *
+ *
* if (rs >= 0x30 && MB_CUR_MAX > 1) {
- *
+ *
* (this catches also the space character) but if portability to EBCDIC
* systems is desired, your code is fine as is.
- *
+ *
* Bruno
*/
/* Thus, the check for \n here; big speedup ! */
@@ -3665,7 +3665,7 @@ get_a_record(char **out, /* pointer to pointer to data */
*errcode = errno;
if (errno_io_retry() && retryable(iop))
return -2;
- iop->flag |= IOP_AT_EOF;
+ iop->flag |= IOP_AT_EOF;
return EOF;
} else {
iop->dataend = iop->buf + iop->count;
@@ -3853,7 +3853,7 @@ set_RS()
* in case of fatal error in make_regexp.
*/
refree(RS_re_yes_case); /* NULL argument is ok */
- refree(RS_re_no_case);
+ refree(RS_re_no_case);
RS_re_yes_case = RS_re_no_case = RS_regexp = NULL;
if (RS->stlen == 0) {
@@ -3978,9 +3978,9 @@ inetfile(const char *str, struct inet_socket_info *isi)
isi->localport.offset = cp-str;
while (*cp != '/' && *cp != '\0')
cp++;
- /*
+ /*
* Require a port, let them explicitly put 0 if
- * they don't care.
+ * they don't care.
*/
if (*cp != '/' || ((isi->localport.len = (cp-str)-isi->localport.offset) == 0))
return false;
@@ -3989,7 +3989,7 @@ inetfile(const char *str, struct inet_socket_info *isi)
cp++;
isi->remotehost.offset = cp-str;
while (*cp != '/' && *cp != '\0')
- cp++;
+ cp++;
if (*cp != '/' || ((isi->remotehost.len = (cp-str)-isi->remotehost.offset) == 0))
return false;
@@ -4005,7 +4005,7 @@ inetfile(const char *str, struct inet_socket_info *isi)
*/
isi->remoteport.offset = cp-str;
while (*cp != '/' && *cp != '\0')
- cp++;
+ cp++;
if (*cp != '\0' || ((isi->remoteport.len = (cp-str)-isi->remoteport.offset) == 0))
return false;
@@ -4021,14 +4021,14 @@ inetfile(const char *str, struct inet_socket_info *isi)
/*
* in_PROCINFO --- return value for a PROCINFO element with
* SUBSEP seperated indices.
- */
+ */
static NODE *
in_PROCINFO(const char *pidx1, const char *pidx2, NODE **full_idx)
{
char *str;
size_t str_len;
- NODE *r, *sub = NULL;
+ NODE *r, *sub = NULL;
NODE *subsep = SUBSEP_node->var_value;
if (PROCINFO_node == NULL || (pidx1 == NULL && pidx2 == NULL))
diff --git a/main.c b/main.c
index 88d7cd51..7da650bd 100644
--- a/main.c
+++ b/main.c
@@ -1,23 +1,23 @@
/*
- * main.c -- Code generator and main program for gawk.
+ * main.c -- Code generator and main program for gawk.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -357,7 +357,7 @@ main(int argc, char **argv)
init_debug();
#ifdef HAVE_MPFR
- /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */
+ /* Set up MPFR defaults, and register pre-exec hook to process arithmetic opcodes */
if (do_mpfr)
init_mpfr(DEFAULT_PREC, DEFAULT_ROUNDMODE);
#endif
@@ -458,7 +458,7 @@ main(int argc, char **argv)
/* Read in the program */
if (parse_program(& code_block) != 0)
exit(EXIT_FAILURE);
-
+
if (do_intl)
exit(EXIT_SUCCESS);
@@ -520,7 +520,7 @@ main(int argc, char **argv)
if (do_tidy_mem)
release_all_vars();
-
+
/* keep valgrind happier */
if (extra_stack)
efree(extra_stack);
@@ -663,7 +663,7 @@ GNU General Public License for more details.\n\
static const char blurb_part3[] =
N_("You should have received a copy of the GNU General Public License\n\
along with this program. If not, see http://www.gnu.org/licenses/.\n");
-
+
/* multiple blurbs are needed for some brain dead compilers. */
printf(_(blurb_part1), UPDATE_YEAR); /* Last update year */
fputs(_(blurb_part2), stdout);
@@ -774,7 +774,7 @@ static const struct varinit varinit[] = {
{&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 },
-{&PREC_node, "PREC", NULL, DEFAULT_PREC, NULL, set_PREC, false, NON_STANDARD},
+{&PREC_node, "PREC", NULL, DEFAULT_PREC, NULL, set_PREC, false, NON_STANDARD},
{&NF_node, "NF", NULL, -1, update_NF, set_NF, false, 0 },
{&NR_node, "NR", NULL, 0, update_NR, set_NR, true, 0 },
{&OFMT_node, "OFMT", "%.6g", 0, NULL, set_OFMT, true, 0 },
@@ -1153,7 +1153,7 @@ arg_assign(char *arg, bool initing)
if (! initing) {
var = lookup(arg);
if (var != NULL && var->type == Node_func)
- fatal(_("cannot use function `%s' as variable name"), arg);
+ fatal(_("cannot use function `%s' as variable name"), arg);
}
/*
@@ -1275,7 +1275,7 @@ version()
#ifdef HAVE_MPFR
printf(" (GNU MPFR %s, GNU MP %s)", mpfr_get_version(), gmp_version);
#endif
- printf("\n");
+ printf("\n");
print_ext_versions();
/*
@@ -1358,7 +1358,7 @@ estrdup(const char *str, size_t len)
s[len] = '\0';
return s;
}
-
+
#if defined(HAVE_LOCALE_H)
/* init_locale --- initialize locale info. */
@@ -1428,7 +1428,7 @@ long
getenv_long(const char *name)
{
const char *val;
- long newval;
+ long newval;
if ((val = getenv(name)) != NULL && isdigit((unsigned char) *val)) {
for (newval = 0; *val && isdigit((unsigned char) *val); val++)
newval = (newval * 10) + *val - '0';
@@ -1454,7 +1454,7 @@ parse_args(int argc, char **argv)
/* we do error messages ourselves on invalid options */
opterr = false;
- /* copy argv before getopt gets to it; used to restart the debugger */
+ /* copy argv before getopt gets to it; used to restart the debugger */
save_argv(argc, argv);
/* option processing. ready, set, go! */
@@ -1604,7 +1604,7 @@ parse_args(int argc, char **argv)
case 'r':
do_flags |= DO_INTERVALS;
break;
-
+
case 's':
do_optimize = false;
break;
diff --git a/mbsupport.h b/mbsupport.h
index 37dd219d..e7b40423 100644
--- a/mbsupport.h
+++ b/mbsupport.h
@@ -2,23 +2,23 @@
* mbsupport.h --- Localize determination of whether we have multibyte stuff.
*/
-/*
+/*
* Copyright (C) 2004, 2005, 2011, 2012, 2015, 2016
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/missing_d/ChangeLog b/missing_d/ChangeLog
index 0c87aa05..83f5b93e 100644
--- a/missing_d/ChangeLog
+++ b/missing_d/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-09-07 Arnold D. Robbins <arnold@skeeve.com>
* setenv.c: Update license text in setenv.c. Thanks
diff --git a/missing_d/snprintf.c b/missing_d/snprintf.c
index 6cee2bed..9d692d5a 100644
--- a/missing_d/snprintf.c
+++ b/missing_d/snprintf.c
@@ -2,22 +2,22 @@
* snprintf.c - Implement snprintf and vsnprintf on platforms that need them.
*/
-/*
+/*
* Copyright (C) 2006, 2007 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/mpfr.c b/mpfr.c
index 673553df..c3795d21 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -2,22 +2,22 @@
* mpfr.c - routines for arbitrary-precision number support in gawk.
*/
-/*
+/*
* Copyright (C) 2012, 2013, 2015 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -118,7 +118,7 @@ mpg_node(unsigned int tp)
mpz_init(r->mpg_i);
r->flags = MPZN;
}
-
+
r->valref = 1;
r->flags |= MALLOC|NUMBER|NUMCUR;
r->stptr = NULL;
@@ -151,7 +151,7 @@ mpg_make_number(double x)
return r;
}
-/* mpg_strtoui --- assign arbitrary-precision integral value from a string */
+/* mpg_strtoui --- assign arbitrary-precision integral value from a string */
int
mpg_strtoui(mpz_ptr zi, char *str, size_t len, char **end, int base)
@@ -264,7 +264,7 @@ mpg_zero(NODE *n)
n->flags &= ~MPFN;
}
if (! is_mpg_integer(n)) {
- mpz_init(n->mpg_i); /* this also sets its value to 0 */
+ mpz_init(n->mpg_i); /* this also sets its value to 0 */
n->flags |= MPZN;
} else
mpz_set_si(n->mpg_i, 0);
@@ -335,7 +335,7 @@ done:
if (errno == 0 && ptr == cpend)
return true;
errno = 0;
- return false;
+ return false;
}
/* mpg_force_number --- force a value to be a multiple-precision number */
@@ -384,7 +384,7 @@ mpg_format_val(const char *format, int index, NODE *s)
efree(s->stptr);
s->stptr = r->stptr;
freenode(r); /* Do not unref(r)! We want to keep s->stptr == r->stpr. */
-
+
s->flags |= STRCUR;
free_wstr(s);
return s;
@@ -427,8 +427,8 @@ mpg_cmp(const NODE *t1, const NODE *t2)
/*
- * mpg_update_var --- update NR or FNR.
- * NR_node->var_value(mpz_t) = MNR(mpz_t) * LONG_MAX + NR(long)
+ * mpg_update_var --- update NR or FNR.
+ * NR_node->var_value(mpz_t) = MNR(mpz_t) * LONG_MAX + NR(long)
*/
NODE *
@@ -482,7 +482,7 @@ mpg_set_var(NODE *n)
if (is_mpg_integer(val))
r = val->mpg_i;
else {
- /* convert float to integer */
+ /* convert float to integer */
mpfr_get_z(mpzval, val->mpg_numbr, MPFR_RNDZ);
r = mpzval;
}
@@ -548,7 +548,7 @@ set_PREC()
if (prec <= 0) {
force_number(val);
- prec = get_number_si(val);
+ prec = get_number_si(val);
if (prec < MPFR_PREC_MIN || prec > MPFR_PREC_MAX) {
force_string(val);
warning(_("PREC value `%.*s' is invalid"), (int) val->stlen, val->stptr);
@@ -683,7 +683,7 @@ do_mpfr_atan2(int nargs)
p1 = MP_FLOAT(t1);
p2 = MP_FLOAT(t2);
res = mpg_float();
- /* See MPFR documentation for handling of special values like +inf as an argument */
+ /* See MPFR documentation for handling of special values like +inf as an argument */
tval = mpfr_atan2(res->mpg_numbr, p1, p2, ROUND_MODE);
IEEE_FMT(res->mpg_numbr, tval);
@@ -823,11 +823,11 @@ do_mpfr_compl(int nargs)
mpg_fmt(_("comp(%Rg): fractional value will be truncated"), p)
);
}
-
+
mpfr_get_z(mpzval, p, MPFR_RNDZ); /* float to integer conversion */
zptr = mpzval;
} else {
- /* (tmp->flags & MPZN) != 0 */
+ /* (tmp->flags & MPZN) != 0 */
zptr = tmp->mpg_i;
if (do_lint) {
if (mpz_sgn(zptr) < 0)
@@ -888,8 +888,8 @@ get_intval(NODE *t1, int argnum, const char *op)
mpz_init(pz);
mpfr_get_z(pz, left, MPFR_RNDZ); /* float to integer conversion */
return pz; /* should be freed */
- }
- /* (t1->flags & MPZN) != 0 */
+ }
+ /* (t1->flags & MPZN) != 0 */
pz = t1->mpg_i;
if (do_lint) {
if (mpz_sgn(pz) < 0)
@@ -922,7 +922,7 @@ do_mpfr_lshift(int nargs)
NODE *t1, *t2, *res;
unsigned long shift;
mpz_ptr pz1, pz2;
-
+
t2 = POP_SCALAR();
t1 = POP_SCALAR();
@@ -954,7 +954,7 @@ do_mpfr_rshift(int nargs)
NODE *t1, *t2, *res;
unsigned long shift;
mpz_ptr pz1, pz2;
-
+
t2 = POP_SCALAR();
t1 = POP_SCALAR();
@@ -964,7 +964,7 @@ do_mpfr_rshift(int nargs)
/* N.B: See do_mpfp_lshift. */
shift = mpz_get_ui(pz2); /* GMP integer => unsigned long conversion */
res = mpg_integer();
- mpz_fdiv_q_2exp(res->mpg_i, pz1, shift); /* res = pz1 / 2^shift, round towards −inf */
+ mpz_fdiv_q_2exp(res->mpg_i, pz1, shift); /* res = pz1 / 2^shift, round towards -inf */
free_intval(t1, pz1);
free_intval(t2, pz2);
@@ -1285,13 +1285,13 @@ mpg_tofloat(mpfr_ptr mf, mpz_ptr mz)
/*
* When implicitely converting a GMP integer operand to a MPFR float, use
* a precision sufficiently large to hold the converted value exactly.
- *
+ *
* $ ./gawk -M 'BEGIN { print 13 % 2 }'
* 1
* If the user-specified precision is used to convert the integer 13 to a
* float, one will get:
* $ ./gawk -M 'BEGIN { PREC=2; print 13 % 2.0 }'
- * 0
+ * 0
*/
prec = mpz_sizeinbase(mz, 2); /* most significant 1 bit position starting at 1 */
@@ -1305,7 +1305,7 @@ mpg_tofloat(mpfr_ptr mf, mpz_ptr mz)
else
prec = PRECISION_MIN;
/*
- * Always set the precision to avoid hysteresis, since do_mpfr_func
+ * Always set the precision to avoid hysteresis, since do_mpfr_func
* may copy our precision.
*/
if (prec != mpfr_get_prec(mf))
@@ -1316,7 +1316,7 @@ mpg_tofloat(mpfr_ptr mf, mpz_ptr mz)
}
-/* mpg_add --- add arbitrary-precision numbers */
+/* mpg_add --- add arbitrary-precision numbers */
static NODE *
mpg_add(NODE *t1, NODE *t2)
@@ -1399,7 +1399,7 @@ mpg_mul(NODE *t1, NODE *t2)
}
-/* mpg_pow --- exponentiation involving arbitrary-precision numbers */
+/* mpg_pow --- exponentiation involving arbitrary-precision numbers */
static NODE *
mpg_pow(NODE *t1, NODE *t2)
@@ -1498,11 +1498,11 @@ mpg_mod(NODE *t1, NODE *t2)
}
return r;
}
-
+
/*
* mpg_interpret --- pre-exec hook in the interpreter. Handles
* arithmetic operations with MPFR/GMP numbers.
- */
+ */
static int
mpg_interpret(INSTRUCTION **cp)
@@ -1583,7 +1583,7 @@ quotient:
if (op == Op_quotient)
DEREF(t2);
REPLACE(r);
- break;
+ break;
case Op_mod_i:
t2 = force_number(pc->memory);
diff --git a/msg.c b/msg.c
index 16fef73a..ffca3355 100644
--- a/msg.c
+++ b/msg.c
@@ -2,23 +2,23 @@
* msg.c - routines for error messages.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2001, 2003, 2010-2013
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/node.c b/node.c
index bb2fe437..fa73c1a4 100644
--- a/node.c
+++ b/node.c
@@ -2,23 +2,23 @@
* node.c -- routines for node management
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2001, 2003-2015,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -173,7 +173,7 @@ goodnum:
/*
* The following lookup table is used as an optimization in force_string;
- * (more complicated) variations on this theme didn't seem to pay off, but
+ * (more complicated) variations on this theme didn't seem to pay off, but
* systematic testing might be in order at some point.
*/
static const char *values[] = {
@@ -323,7 +323,7 @@ r_dupnode(NODE *n)
r->flags |= WSTRCUR;
}
}
-
+
return r;
}
@@ -394,7 +394,7 @@ make_str_node(const char *s, size_t len, int flags)
memcpy(r->stptr, s, len);
}
r->stptr[len] = '\0';
-
+
if ((flags & SCAN) != 0) { /* scan for escape sequences */
const char *pf;
char *ptm;
@@ -478,16 +478,16 @@ r_unref(NODE *tmp)
*
* Parse a C escape sequence. STRING_PTR points to a variable containing a
* pointer to the string to parse. That pointer is updated past the
- * characters we use. The value of the escape sequence is returned.
+ * characters we use. The value of the escape sequence is returned.
*
* A negative value means the sequence \ newline was seen, which is supposed to
- * be equivalent to nothing at all.
+ * be equivalent to nothing at all.
*
* If \ is followed by a null character, we return a negative value and leave
- * the string pointer pointing at the null character.
+ * the string pointer pointing at the null character.
*
* If \ is followed by 000, we return 0 and leave the string pointer after the
- * zeros. A value of 0 does not mean end of string.
+ * zeros. A value of 0 does not mean end of string.
*
* POSIX doesn't allow \x.
*/
@@ -981,7 +981,7 @@ void init_btowc_cache()
#define BLOCKCHUNK 100
BLOCK nextfree[BLOCK_MAX] = {
- { 0, NULL}, /* invalid */
+ { 0, NULL}, /* invalid */
{ sizeof(NODE), NULL },
{ sizeof(BUCKET), NULL },
};
diff --git a/nonposix.h b/nonposix.h
index 3aae512c..0a1c24c8 100644
--- a/nonposix.h
+++ b/nonposix.h
@@ -2,22 +2,22 @@
* nonposix.h --- definitions needed on non-POSIX systems.
*/
-/*
+/*
* Copyright (C) 2012, 2013, 2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/old-extension/ChangeLog b/old-extension/ChangeLog
index 3c91b7cd..bd848f9a 100644
--- a/old-extension/ChangeLog
+++ b/old-extension/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2015-04-09 Andrew J. Schorr <aschorr@telemetry-investments.com>
* bindarr.c (do_bind_array): Undo Arnold's change of 2014-12-18.
diff --git a/old-extension/bindarr.c b/old-extension/bindarr.c
index 41467425..1a0104db 100644
--- a/old-extension/bindarr.c
+++ b/old-extension/bindarr.c
@@ -3,22 +3,22 @@
* to array and array elements.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2011 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -286,7 +286,7 @@ do_unbind_array(int nargs)
*symbol = *xn;
freenode(xn);
- return make_number(0);
+ return make_number(0);
}
diff --git a/old-extension/fileop.c b/old-extension/fileop.c
index d76a7ded..97a51c81 100644
--- a/old-extension/fileop.c
+++ b/old-extension/fileop.c
@@ -5,20 +5,20 @@
/*
* Copyright (C) 2012 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -379,7 +379,7 @@ dlload(NODE *tree, void *dl)
}
-/* dlunload --- routine called when exiting */
+/* dlunload --- routine called when exiting */
void
dlunload()
diff --git a/old-extension/sparr.c b/old-extension/sparr.c
index a3d06e66..1e8642dd 100644
--- a/old-extension/sparr.c
+++ b/old-extension/sparr.c
@@ -5,20 +5,20 @@
/*
* Copyright (C) 2012 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -75,7 +75,7 @@ static void
store_SYS(NODE *symbol, NODE *subs, NODE *val, void *data)
{
sdata_t *sd = (sdata_t *) data;
-
+
if (subs != NULL && val != NULL && val->type == Node_val) {
force_string(subs);
if (strcmp(subs->stptr, "readline") == 0) {
@@ -98,7 +98,7 @@ load_READLINE(NODE *symbol, void *data)
int i;
bool long_line = false;
- if (! sd->load_file) /* non-existent SYS["readline"] or already loaded */
+ if (! sd->load_file) /* non-existent SYS["readline"] or already loaded */
return;
file = sd->filename;
@@ -145,7 +145,7 @@ load_READLINE(NODE *symbol, void *data)
}
fclose(fp);
sd->load_file = false; /* don't load this file again */
-}
+}
/* dlload --- load this library */
diff --git a/old-extension/spec_array.c b/old-extension/spec_array.c
index 34d15fc5..f933aa35 100644
--- a/old-extension/spec_array.c
+++ b/old-extension/spec_array.c
@@ -4,20 +4,20 @@
/*
* Copyright (C) 2012, 2014 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -52,7 +52,7 @@ typedef struct spec_array {
* void load_func(NODE *array, void *data)
*
* Use register_deferred_array(array, load_func, void *data) to
- * bind an array to the load routine.
+ * bind an array to the load routine.
*/
static NODE **deferred_array_init(NODE *, NODE *);
@@ -72,7 +72,7 @@ static afunc_t deferred_array_func[] = {
deferred_array_exists,
deferred_array_clear,
deferred_array_remove,
- deferred_array_list,
+ deferred_array_list,
deferred_array_copy,
null_afunc, /* dump */
(afunc_t) 0, /* store */
@@ -86,7 +86,7 @@ deferred_array_init(NODE *symbol, NODE *subs)
{
if (symbol != NULL) {
array_t *av = (array_t *) symbol->xarray;
- symbol->xarray = NULL; /* this is to avoid an assertion failure in null_array */
+ symbol->xarray = NULL; /* this is to avoid an assertion failure in null_array */
null_array(symbol); /* typeless empty array */
if (symbol->parent_array == NULL) {
/* main array */
@@ -141,7 +141,7 @@ static NODE **
deferred_array_remove(NODE *symbol, NODE *subs)
{
array_t *av = (array_t *) symbol->xarray;
-
+
(void) SUPER(aremove)(symbol, subs);
if (av) {
symbol->xarray = NULL;
@@ -157,7 +157,7 @@ static NODE **
deferred_array_clear(NODE *symbol, NODE *subs)
{
array_t *av = (array_t *) symbol->xarray;
-
+
(void) SUPER(aclear)(symbol, subs);
if (av) {
symbol->xarray = NULL;
@@ -181,7 +181,7 @@ deferred_array_clear(NODE *symbol, NODE *subs)
* The store routine must take an additional argument for the
* value. The value can be NULL if the specific element is
* removed from the array. The subscript (and the value) is NULL
- * when the entire array is deleted.
+ * when the entire array is deleted.
*
* void store_func(NODE *array, NODE *subs, NODE *value, void *data)
*
@@ -207,7 +207,7 @@ static afunc_t dyn_array_func[] = {
dyn_array_exists,
dyn_array_clear,
dyn_array_remove,
- dyn_array_list,
+ dyn_array_list,
dyn_array_copy,
null_afunc, /* dump */
dyn_array_store,
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 8d844018..2b4b1183 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-09-24 Eli Zaretskii <eliz@gnu.org>
Fix compilation warnings on MinGW with the latest runtime.
diff --git a/pc/popen.c b/pc/popen.c
index 73770d98..425d32b9 100644
--- a/pc/popen.c
+++ b/pc/popen.c
@@ -104,7 +104,7 @@ scriptify(const char *command)
free(cmd);
cmd = NULL;
}
- if (fp) fclose(fp);
+ if (fp) fclose(fp);
return(cmd);
}
diff --git a/posix/ChangeLog b/posix/ChangeLog
index c5ce0340..cd1a2f68 100644
--- a/posix/ChangeLog
+++ b/posix/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.4: Release tar ball made.
diff --git a/posix/gawkmisc.c b/posix/gawkmisc.c
index d422bd0f..40950826 100644
--- a/posix/gawkmisc.c
+++ b/posix/gawkmisc.c
@@ -1,5 +1,5 @@
/* gawkmisc.c --- miscellaneous gawk routines that are OS specific.
-
+
Copyright (C) 1986, 1988, 1989, 1991 - 1998, 2001 - 2004, 2011
the Free Software Foundation, Inc.
@@ -40,7 +40,7 @@ char *
gawk_name(const char *filespec)
{
char *p;
-
+
/* "path/name" -> "name" */
p = strrchr(filespec, '/');
return (p == NULL ? (char *) filespec : p + 1);
@@ -272,7 +272,7 @@ os_isatty(int fd)
{
return isatty(fd);
}
-
+
/* files_are_same --- return true if files are identical */
int
diff --git a/profile.c b/profile.c
index 21d563e5..c60fd296 100644
--- a/profile.c
+++ b/profile.c
@@ -2,22 +2,22 @@
* profile.c - gawk bytecode pretty-printer with counts
*/
-/*
+/*
* Copyright (C) 1999-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -226,10 +226,10 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
case Op_rule:
/*
* Rules are three instructions long.
- * See append_rule in awkgram.y.
- * The first has the Rule Op Code, nexti etc.
+ * See append_rule in awkgram.y.
+ * The first has the Rule Op Code, nexti etc.
* The second, (pc + 1) has firsti and lasti:
- * the first/last ACTION instructions for this rule.
+ * the first/last ACTION instructions for this rule.
* The third has first_line and last_line:
* the first and last source line numbers.
*/
@@ -266,7 +266,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
t1 = pp_pop();
fprintf(prof_fp, "%s {", t1->pp_str);
pp_free(t1);
- } else
+ } else
fprintf(prof_fp, "{");
ip1 = (pc + 1)->firsti;
ip2 = (pc + 1)->lasti;
@@ -348,7 +348,7 @@ pprint(INSTRUCTION *startp, INSTRUCTION *endp, int flags)
cant_happen();
}
- switch (pc->opcode) {
+ switch (pc->opcode) {
case Op_store_var:
t2 = pp_pop(); /* l.h.s. */
t1 = pp_pop(); /* r.h.s. */
@@ -391,7 +391,7 @@ cleanup:
efree(tmp);
pp_free(t1);
pp_push(pc->opcode, str, CAN_FREE);
- break;
+ break;
case Op_and:
case Op_or:
@@ -504,7 +504,7 @@ cleanup:
pp_free(t1);
if ((flags & IN_FOR_HEADER) == 0)
pc = end_line(pc);
- break;
+ break;
case Op_concat:
str = pp_concat(pc->expr_count);
@@ -521,7 +521,7 @@ cleanup:
sub = pp_list(pc->expr_count, NULL, pc->expr_count > 1 ? "][" : ", ");
fprintf(prof_fp, "%s %s[%s]", op2str(Op_K_delete), array, sub);
efree(sub);
- } else
+ } else
fprintf(prof_fp, "%s %s", op2str(Op_K_delete), array);
if ((flags & IN_FOR_HEADER) == 0)
pc = end_line(pc);
@@ -533,7 +533,7 @@ cleanup:
/* Efficency hack not in effect because of exec_count instruction */
cant_happen();
break;
-
+
case Op_in_array:
{
char *array, *sub;
@@ -562,7 +562,7 @@ cleanup:
case Op_field_assign:
case Op_subscript_assign:
case Op_arrayfor_init:
- case Op_arrayfor_incr:
+ case Op_arrayfor_incr:
case Op_arrayfor_final:
case Op_newfile:
case Op_get_record:
@@ -623,7 +623,7 @@ cleanup:
else {
tmp = pp_list(pc->expr_count, " ", ", ");
tmp[strlen(tmp) - 1] = '\0'; /* remove trailing space */
- }
+ }
if (pc->redir_type != 0) {
t1 = pp_pop();
@@ -642,7 +642,7 @@ cleanup:
case Op_push_re:
if (pc->memory->type != Node_regex && pc->memory->type != Node_typedregex)
break;
- /* else
+ /* else
fall through */
case Op_match_rec:
{
@@ -725,7 +725,7 @@ cleanup:
if (pc->opcode == Op_indirect_func_call)
pre = "@";
else
- pre = "";
+ pre = "";
pcount = (pc + 1)->expr_count;
if (pcount > 0) {
tmp = pp_list(pcount, "()", ", ");
@@ -821,7 +821,7 @@ cleanup:
case Op_K_for:
ip1 = pc + 1;
indent(ip1->forloop_body->exec_count);
- fprintf(prof_fp, "%s (", op2str(pc->opcode));
+ fprintf(prof_fp, "%s (", op2str(pc->opcode));
/* If empty for looop header, print it a little more nicely. */
if ( pc->nexti->opcode == Op_no_op
@@ -999,7 +999,7 @@ cleanup:
pc = ip1->nexti;
assert(pc->opcode == Op_cond_exp);
- pprint(pc->nexti, pc->branch_end, NO_PPRINT_FLAGS);
+ pprint(pc->nexti, pc->branch_end, NO_PPRINT_FLAGS);
f = pp_pop();
t = pp_pop();
@@ -1015,7 +1015,7 @@ cleanup:
pp_push(Op_cond_exp, str, CAN_FREE);
pc = pc->branch_end;
}
- break;
+ break;
case Op_exec_count:
if (flags == NO_PPRINT_FLAGS)
@@ -1051,7 +1051,7 @@ end_line(INSTRUCTION *ip)
print_comment(ip->nexti, -1);
ret = ip->nexti;
}
- else
+ else
fprintf(prof_fp, "\n");
return ret;
@@ -1573,7 +1573,7 @@ pp_list(int nargs, const char *paren, const char *delim)
emalloc(str, char *, len + 1, "pp_list");
s = str;
if (paren != NULL)
- *s++ = paren[0];
+ *s++ = paren[0];
if (nargs > 0) {
r = pp_args[nargs];
memcpy(s, r->pp_str, r->pp_len);
@@ -1593,7 +1593,7 @@ pp_list(int nargs, const char *paren, const char *delim)
if (paren != NULL)
*s++ = paren[1];
*s = '\0';
- return str;
+ return str;
}
/* is_unary_minus --- return true if string starts with unary minus */
@@ -1668,7 +1668,7 @@ pp_concat(int nargs)
*s++ = ' ';
}
}
-
+
pl_l = prec_level(pp_args[nargs-1]->type);
pl_r = prec_level(pp_args[nargs]->type);
r = pp_args[nargs];
@@ -1684,7 +1684,7 @@ pp_concat(int nargs)
pp_free(r);
*s = '\0';
- return str;
+ return str;
}
/* pp_group3 --- string together up to 3 strings */
diff --git a/protos.h b/protos.h
index 7bef8b84..5693a43b 100644
--- a/protos.h
+++ b/protos.h
@@ -2,22 +2,22 @@
* protos.h -- function prototypes for when the headers don't have them.
*/
-/*
+/*
* Copyright (C) 1991 - 2002, 2011 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -64,7 +64,7 @@ extern size_t strftime(char *, size_t, const char *, const struct tm *);
extern time_t time(time_t *);
extern FILE *fdopen(int, const char *);
-extern int fprintf(FILE *, const char *, ...);
+extern int fprintf(FILE *, const char *, ...);
#if ! defined(__GNU_LIBRARY__)
extern size_t fwrite(const aptr_t, size_t, size_t, FILE *);
#endif
@@ -124,7 +124,7 @@ extern unsigned long int strtoul(const char *, char **endptr, int base);
#ifndef HAVE_TZSET
extern void tzset();
#endif
-
+
#ifndef HAVE_MKTIME
extern time_t mktime(struct tm *tp);
#endif
diff --git a/random.h b/random.h
index d4c6ef16..84b31414 100644
--- a/random.h
+++ b/random.h
@@ -2,22 +2,22 @@
* random.h - redefine name of random lib routines to avoid conflicts
*/
-/*
+/*
* Copyright (C) 1996, 2001, 2004, 2005, 2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
diff --git a/re.c b/re.c
index 13173290..4360d307 100644
--- a/re.c
+++ b/re.c
@@ -2,22 +2,22 @@
* re.c - compile regular expressions.
*/
-/*
+/*
* Copyright (C) 1991-2016 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -75,7 +75,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal)
/*
* Build a copy of the string (in buf) with the
* escaped characters translated, and generate the regex
- * from that.
+ * from that.
*/
if (buf == NULL) {
emalloc(buf, char *, len + 1, "make_regexp");
@@ -243,7 +243,7 @@ make_regexp(const char *s, size_t len, bool ignorecase, bool dfa, bool canfatal)
break;
}
}
-
+
return rp;
}
@@ -315,7 +315,7 @@ void
refree(Regexp *rp)
{
if (rp == NULL)
- return;
+ return;
rp->pat.translate = NULL;
regfree(& rp->pat);
if (rp->regs.start)
diff --git a/regcomp.c b/regcomp.c
index b19c2f95..5ac53701 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -216,7 +216,7 @@ static const size_t __re_error_msgid_idx[] =
#ifndef HAVE_BTOWC
-wchar_t
+wchar_t
btowc (int c)
{
wchar_t wtmp[2];
diff --git a/replace.c b/replace.c
index 6d345f52..db7f0893 100644
--- a/replace.c
+++ b/replace.c
@@ -2,22 +2,22 @@
* replace.c -- Get replacement versions of functions.
*/
-/*
+/*
* Copyright (C) 1989, 1991-2013 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -84,7 +84,7 @@
#ifndef HAVE_TZSET
#include "missing_d/tzset.c"
#endif /* HAVE_TZSET */
-
+
#ifndef HAVE_MKTIME
/* mktime.c defines main() if DEBUG is set */
#undef DEBUG
diff --git a/str_array.c b/str_array.c
index f66b22cc..65e0b741 100644
--- a/str_array.c
+++ b/str_array.c
@@ -2,23 +2,23 @@
* str_array.c - routines for associative arrays of string indices.
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2013, 2016,
* the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -126,7 +126,7 @@ str_array_init(NODE *symbol ATTRIBUTE_UNUSED, NODE *subs ATTRIBUTE_UNUSED)
* isn't there. Returns a pointer ala get_lhs to where its value is stored.
*
* SYMBOL is the address of the node (or other pointer) being dereferenced.
- * SUBS is a number or string used as the subscript.
+ * SUBS is a number or string used as the subscript.
*/
static NODE **
@@ -194,7 +194,7 @@ str_lookup(NODE *symbol, NODE *subs)
}
subs = tmp;
} else {
- /* string value already "frozen" */
+ /* string value already "frozen" */
subs = dupnode(subs);
}
@@ -245,7 +245,7 @@ str_clear(NODE *symbol, NODE *subs ATTRIBUTE_UNUSED)
r = b->ahvalue;
if (r->type == Node_var_array) {
assoc_clear(r); /* recursively clear all sub-arrays */
- efree(r->vname);
+ efree(r->vname);
freenode(r);
} else
unref(r);
@@ -322,7 +322,7 @@ str_copy(NODE *symbol, NODE *newsymb)
BUCKET **old, **new, **pnew;
BUCKET *chain, *newchain;
unsigned long cursize, i;
-
+
assert(symbol->table_size > 0);
/* find the current hash size */
@@ -368,7 +368,7 @@ str_copy(NODE *symbol, NODE *newsymb)
newchain->ahnext = NULL;
pnew = & newchain->ahnext;
}
- }
+ }
newsymb->table_size = symbol->table_size;
newsymb->buckets = new;
@@ -402,9 +402,9 @@ str_list(NODE *symbol, NODE *t)
if ((assoc_kind & (AINDEX|AVALUE|ADELETE)) == (AINDEX|ADELETE))
num_elems = 1;
list_size = elem_size * num_elems;
-
+
emalloc(list, NODE **, list_size * sizeof(NODE *), "str_list");
-
+
/* populate it */
for (i = 0; i < symbol->array_size; i++) {
@@ -428,7 +428,7 @@ str_list(NODE *symbol, NODE *t)
}
if (k >= list_size)
return list;
- }
+ }
}
return list;
}
@@ -445,7 +445,7 @@ str_kilobytes(NODE *symbol)
bucket_cnt = symbol->table_size;
/* This does not include extra memory for indices with stfmt != -1 */
- kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
+ kb = (((AWKNUM) bucket_cnt) * sizeof (BUCKET) +
((AWKNUM) symbol->array_size) * sizeof (BUCKET *)) / 1024.0;
return kb;
}
@@ -533,7 +533,7 @@ str_dump(NODE *symbol, NODE *ndump)
return NULL;
#undef HCNT
-}
+}
/* awk_hash --- calculate the hash function of the string in subs */
@@ -646,11 +646,11 @@ grow_table(NODE *symbol)
* very large (> 8K), we just double more or less, instead of
* just jumping from 8K to 64K.
*/
-
+
static const unsigned long sizes[] = {
13, 127, 1021, 8191, 16381, 32749, 65497,
131101, 262147, 524309, 1048583, 2097169,
- 4194319, 8388617, 16777259, 33554467,
+ 4194319, 8388617, 16777259, 33554467,
67108879, 134217757, 268435459, 536870923,
1073741827
};
diff --git a/symbol.c b/symbol.c
index aab0c470..e1504300 100644
--- a/symbol.c
+++ b/symbol.c
@@ -2,22 +2,22 @@
* symbol.c - routines for symbol table management and code allocation
*/
-/*
+/*
* Copyright (C) 1986, 1988, 1989, 1991-2015 the Free Software Foundation, Inc.
- *
+ *
* This file is part of GAWK, the GNU implementation of the
* AWK Programming Language.
- *
+ *
* GAWK is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
- *
+ *
* GAWK is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
@@ -71,7 +71,7 @@ init_symbol_table()
/*
* install_symbol:
* Install a global name in the symbol table, even if it is already there.
- * Caller must check against redefinition if that is desired.
+ * Caller must check against redefinition if that is desired.
*/
NODE *
@@ -129,7 +129,7 @@ make_params(char **pnames, int pcount)
{
NODE *p, *parms;
int i;
-
+
if (pcount <= 0 || pnames == NULL)
return NULL;
@@ -242,12 +242,12 @@ destroy_symbol(NODE *r)
NODE *n;
int i;
int pcount = r->param_cnt;
-
- /* function parameters of type Node_param_list */
+
+ /* function parameters of type Node_param_list */
for (i = 0; i < pcount; i++) {
n = r->fparms + i;
efree(n->param);
- }
+ }
efree(r->fparms);
}
break;
@@ -260,7 +260,7 @@ destroy_symbol(NODE *r)
assoc_clear(r);
break;
- case Node_var:
+ case Node_var:
unref(r->var_value);
break;
@@ -369,7 +369,7 @@ comp_symbol(const void *v1, const void *v2)
typedef enum { FUNCTION = 1, VARIABLE } SYMBOL_TYPE;
/* get_symbols --- return a list of optionally sorted symbols */
-
+
static NODE **
get_symbols(SYMBOL_TYPE what, bool sort)
{
@@ -448,7 +448,7 @@ function_list(bool sort)
return get_symbols(FUNCTION, sort);
}
-/* print_vars --- print names and values of global variables */
+/* print_vars --- print names and values of global variables */
void
print_vars(NODE **table, int (*print_func)(FILE *, const char *, ...), FILE *fp)
@@ -708,7 +708,7 @@ bcfree(INSTRUCTION *cp)
cp->opcode = 0;
cp->nexti = pool_list->freei;
pool_list->freei = cp;
-}
+}
/* bcalloc --- allocate a new instruction */
@@ -804,7 +804,7 @@ push_context(AWK_CONTEXT *ctxt)
ctxt_level++;
}
-/* pop_context --- switch to previous execution context. */
+/* pop_context --- switch to previous execution context. */
void
pop_context()
@@ -831,7 +831,7 @@ in_main_context()
return (ctxt_level == 1);
}
-/* free_context --- free context structure and related data. */
+/* free_context --- free context structure and related data. */
void
free_context(AWK_CONTEXT *ctxt, bool keep_globals)
@@ -864,7 +864,7 @@ free_context(AWK_CONTEXT *ctxt, bool keep_globals)
efree(ctxt);
}
-/* free_bc_internal --- free internal memory of an instruction. */
+/* free_bc_internal --- free internal memory of an instruction. */
static void
free_bc_internal(INSTRUCTION *cp)
@@ -888,7 +888,7 @@ free_bc_internal(INSTRUCTION *cp)
if (m->re_text != NULL)
unref(m->re_text);
freenode(m);
- break;
+ break;
case Op_token:
/* token lost during error recovery in yyparse */
if (cp->lextok != NULL)
@@ -906,7 +906,7 @@ free_bc_internal(INSTRUCTION *cp)
case Op_illegal:
cant_happen();
default:
- break;
+ break;
}
}
diff --git a/vms/ChangeLog b/vms/ChangeLog
index 710a35f8..29f0363a 100644
--- a/vms/ChangeLog
+++ b/vms/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-23 Arnold D. Robbins <arnold@skeeve.com>
+
+ * General: Remove trailing whitespace from all relevant files.
+
2016-08-25 Arnold D. Robbins <arnold@skeeve.com>
* 4.1.4: Release tar ball made.
diff --git a/vms/vms_gawk.c b/vms/vms_gawk.c
index 4080e1db..0caab21f 100644
--- a/vms/vms_gawk.c
+++ b/vms/vms_gawk.c
@@ -16,7 +16,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-
+
/*
* vms_gawk.c - routines to parse the command line as a native DCL command