snapshot of project "mawk", label t20200120

This commit is contained in:
Thomas E. Dickey 2020-01-20 22:32:27 +00:00
parent ddd16d1657
commit 2634298c3d
24 changed files with 785 additions and 671 deletions

View File

@ -1,7 +1,13 @@
-- $MawkId: CHANGES,v 1.270 2020/01/07 02:12:10 tom Exp $
-- $MawkId: CHANGES,v 1.273 2020/01/20 11:44:41 tom Exp $
Changes by Thomas E Dickey <dickey@invisible-island.net>
20200120
+ resync with my-autoconf.
+ fix typos found with codespell.
+ when reading input in interactive mode, provide for extending the
buffer size for very long lines (Original-Mawk #59).
20200106
+ correct line-number shown in too-many-arguments error message for
the case where the function is a forward reference (report by

View File

@ -1,4 +1,4 @@
MANIFEST for mawk, version t20200106
MANIFEST for mawk, version t20200120
--------------------------------------------------------------------------------
MANIFEST this file
ACKNOWLEDGMENT acknowledgements

56
aclocal.m4 vendored
View File

@ -1,4 +1,4 @@
dnl $MawkId: aclocal.m4,v 1.86 2020/01/06 01:04:12 tom Exp $
dnl $MawkId: aclocal.m4,v 1.88 2020/01/20 11:39:30 tom Exp $
dnl custom mawk macros for autoconf
dnl
dnl The symbols beginning "CF_MAWK_" were originally written by Mike Brennan,
@ -32,6 +32,10 @@ dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl
dnl ---------------------------------------------------------------------------
dnl See
dnl https://invisible-island.net/autoconf/autoconf.html
dnl https://invisible-island.net/autoconf/my-autoconf.html
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
dnl ------------------
@ -504,7 +508,7 @@ cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_CONST_X_STRING version: 1 updated: 2019/04/08 17:50:29
dnl CF_CONST_X_STRING version: 3 updated: 2020/01/11 18:39:22
dnl -----------------
dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most
dnl character-strings.
@ -525,6 +529,10 @@ dnl when compiling the library and compiling using the library, to tell the
dnl compiler that String is const.
AC_DEFUN([CF_CONST_X_STRING],
[
AC_REQUIRE([AC_PATH_XTRA])
CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING])
AC_TRY_COMPILE(
[
#include <stdlib.h>
@ -546,6 +554,8 @@ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[
])
])
CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING])
case $cf_cv_const_x_string in
(no)
CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
@ -1346,7 +1356,7 @@ int main(void)
return 0 ;
}]])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MAWK_RUN_FPE_TESTS version: 14 updated: 2015/05/02 07:59:43
dnl CF_MAWK_RUN_FPE_TESTS version: 15 updated: 2020/01/18 12:30:33
dnl ---------------------
dnl These are mawk's dreaded FPE tests.
AC_DEFUN([CF_MAWK_RUN_FPE_TESTS],
@ -1491,7 +1501,7 @@ EOF
Please report this so I can fix this script to do it automatically.
CF_MAWK_MAINTAINER
You can continue with the build and the resulting mawk will be
useable, but getting FPE_TRAPS_ON correct eventually is best.
usable, but getting FPE_TRAPS_ON correct eventually is best.
EOF
fi
;;
@ -1508,7 +1518,7 @@ EOF
cat 1>&2 <<-EOF
The program \`fpe_check' will not work for cross-compiling.
You can continue with the build and the resulting mawk will be
useable, but getting FPE_TRAPS_ON correct eventually is best.
usable, but getting FPE_TRAPS_ON correct eventually is best.
EOF
fi
;;
@ -1877,6 +1887,42 @@ $1=`echo "$2" | \
-e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45
dnl ---------------------
dnl Restore flags saved in CF_SAVE_XTRA_FLAGS
dnl $1 = name of current macro
define([CF_RESTORE_XTRA_FLAGS],
[
LIBS="$cf_save_LIBS_$1"
CFLAGS="$cf_save_CFLAGS_$1"
CPPFLAGS="$cf_save_CPPFLAGS_$1"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44
dnl ------------------
dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers
dnl and libraries which do not update those variables.
dnl
dnl $1 = name of current macro
define([CF_SAVE_XTRA_FLAGS],
[
cf_save_LIBS_$1="$LIBS"
cf_save_CFLAGS_$1="$CFLAGS"
cf_save_CPPFLAGS_$1="$CPPFLAGS"
LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
for cf_X_CFLAGS in $X_CFLAGS
do
case "x$cf_X_CFLAGS" in
x-[[IUD]]*)
CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
;;
*)
CFLAGS="$CFLAGS $cf_X_CFLAGS"
;;
esac
done
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_SET_MATH_LIB_VERSION version: 1 updated: 2013/12/26 20:21:00
dnl -----------------------
dnl Check if math.h declares _LIB_VERSION, and if so, whether we can modify it

View File

@ -1,8 +1,8 @@
/* array.c */
/*
@MawkId: array.w,v 1.18 2014/08/14 23:34:44 mike Exp @
@MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp @
copyright 2009,2010, Thomas E. Dickey
copyright 2009-2019,2020 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -270,7 +270,7 @@ STRING** array_loop_vector(
}
}
if (getenv("WHINY_USERS") != NULL) /* gawk compability */
if (getenv("WHINY_USERS") != NULL) /* gawk compatibility */
qsort(ret, A->size, sizeof(STRING*), string_compare);
return ret ;
}

View File

@ -1,8 +1,8 @@
/* array.h */
/*
@MawkId: array.w,v 1.18 2014/08/14 23:34:44 mike Exp @
@MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp @
copyright 2009,2010, Thomas E. Dickey
copyright 2009-2019,2020 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of

22
array.w
View File

@ -1,21 +1,7 @@
% @Log: array.w,v @
% Revision 1.4 1996/09/18 00:37:25 mike
% 1) Fix stupid bozo in A[expr], expr is numeric and not integer.
% 2) Add static for non-ansi compilers.
% 3) Minor tweaks to documentation.
%
% Revision 1.3 1996/07/28 21:55:32 mike
% trivial change -- add extra {}
%
% Revision 1.2 1996/02/25 23:42:25 mike
% Fix zfree bug in array_clear.
% Clean up documentation.
%
\input mwebmac
\input ctmac
\RCSID{$Id: array.w,v 1.18 2014/08/14 23:34:44 mike Exp $}
\RCSID{$MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp $}
\TOC{Mawk Arrays}
@ -931,7 +917,7 @@ STRING** array_loop_vector(
if (!(A->type & AY_STR)) add_string_associations(A) ;
ret = (STRING**) zmalloc(A->size*sizeof(STRING*)) ;
<<for each [[ANODE]] in [[A]], put one string in [[ret]]>>
if (getenv("WHINY_USERS") != NULL) /* gawk compability */
if (getenv("WHINY_USERS") != NULL) /* gawk compatibility */
qsort(ret, A->size, sizeof(STRING*), string_compare);
return ret ;
}
@ -1086,9 +1072,9 @@ return sp ;
<<blurb>>=
/*
$MawkId: array.w,v 1.18 2014/08/14 23:34:44 mike Exp $
$MawkId: array.w,v 1.21 2020/01/20 11:54:19 tom Exp $
copyright 2009,2010, Thomas E. Dickey
copyright 2009-2019,2020 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of

1173
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
dnl $MawkId: configure.in,v 1.59 2019/12/31 19:13:23 tom Exp $
dnl $MawkId: configure.in,v 1.60 2020/01/20 11:43:28 tom Exp $
dnl configure.in for mawk
dnl ###########################################################################
dnl copyright 2008-2015,2019, Thomas E. Dickey
dnl copyright 2008-2019,2020, Thomas E. Dickey
dnl copyright 1991-1994,1995, Michael D. Brennan
dnl
dnl This is a source file for mawk, an implementation of
@ -19,6 +19,7 @@ CF_CHECK_CACHE
AC_ARG_PROGRAM
AC_DEFUN([AC_PATH_XTRA],[])
CF_PROG_CC
AC_PROG_MAKE_SET
CF_MAKEFLAGS

View File

@ -19,7 +19,7 @@ function middle(x,y,z) #return middle of 3
function isort(A , n, i, j, hold)
{
# if needed a sentinal at A[0] will be created
# if needed a sentinel at A[0] will be created
for( i = 2 ; i <= n ; i++)
{

View File

@ -1,6 +1,6 @@
/********************************************
field.c
copyright 2008-2014,2016 Thomas E. Dickey
copyright 2008-2016,2020 Thomas E. Dickey
copyright 1991-1995,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: field.c,v 1.35 2016/11/21 02:15:47 tom Exp $
* $MawkId: field.c,v 1.36 2020/01/20 11:47:26 tom Exp $
*/
/* field.c */
@ -260,7 +260,7 @@ split_field0(void)
}
/* the above xxx_split() function put the fields in an anonyous
* buffer that will be pulled into the fields with a transer call */
* buffer that will be pulled into the fields with a transfer call */
/* we are done with cp0 */
if (cp0 == &hold0)

82
fin.c
View File

@ -1,6 +1,6 @@
/********************************************
fin.c
copyright 2008-2014,2018. Thomas E. Dickey
copyright 2008-2018,2020. Thomas E. Dickey
copyright 1991-1995,1996. Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: fin.c,v 1.44 2018/11/15 00:31:57 tom Exp $
* $MawkId: fin.c,v 1.47 2020/01/20 01:56:30 tom Exp $
*/
/* fin.c */
@ -176,25 +176,67 @@ FINgets(FIN * fin, size_t *len_p)
}
if (fin->fp) {
/* line buffering */
if (!fgets(fin->buff, BUFFSZ + 1, fin->fp)) {
fin->flags |= EOF_FLAG;
fin->buff[0] = 0;
fin->buffp = fin->buff;
fin->limit = fin->buffp;
goto restart; /* might be main_fin */
} else { /* return this line */
/* find eol */
p = fin->buff;
while (*p != '\n' && *p != 0)
p++;
int have_nl = 0;
int got_any = 0;
char *my_buff = fin->buff;
*p = 0;
*len_p = (unsigned) (p - fin->buff);
fin->buffp = p;
fin->limit = fin->buffp + strlen(fin->buffp);
return fin->buff;
}
do {
/* line buffering */
if (!fgets(my_buff, BUFFSZ + 1, fin->fp)) {
if (got_any) {
/* no newline, but we have data -- okay */
break;
}
fin->flags |= EOF_FLAG;
fin->buff[0] = 0;
fin->buffp = fin->buff;
fin->limit = fin->buffp;
goto restart; /* might be main_fin */
} else { /* return this line */
/*
* Using fgets, we cannot detect embedded nulls in the
* input. Assume that a null is the one added by fgets
* after reading data. If we have a newline, that is
* better, since fgets has the complete line.
*/
p = my_buff;
while (*p != '\n' && *p != 0)
p++;
if (*p == '\n') {
have_nl = 1;
*p = 0;
} else {
/*
* Increase the buffer size to allow reading more data,
* and point 'my_buff' to the beginning of the extra
* space. Doing it this way assumes very-long lines
* are rare.
*/
size_t old_size = (size_t) (fin->nbuffs++ * BUFFSZ + 1);
size_t new_size = old_size + BUFFSZ;
char *new_buff = (char *) zmalloc(new_size);
size_t my_size = (size_t) (p - fin->buff);
if (new_buff != fin->buff) {
memcpy(new_buff, fin->buff, my_size);
zfree(fin->buff, old_size);
fin->buff = new_buff;
}
my_buff = my_size + fin->buff;
p = my_buff;
got_any = 1;
}
}
} while (!have_nl);
/*
* At this point, 'p' points to the terminating null for the
* input line. Fill in the FIN structure details.
*/
*len_p = (size_t) (p - fin->buff);
fin->buffp = p;
fin->limit = fin->buffp + strlen(fin->buffp);
return fin->buff;
} else {
/* block buffering */
r = fillbuff(fin->fd, fin->buff, (size_t) (fin->nbuffs * BUFFSZ));

View File

@ -1,6 +1,6 @@
# $MawkId: Makefile.in,v 1.2 2020/01/06 10:18:49 tom Exp $
# $MawkId: Makefile.in,v 1.3 2020/01/20 22:32:27 tom Exp $
###############################################################################
# copyright 2010,2015 Thomas E. Dickey
# copyright 2010-2015,2020 Thomas E. Dickey
#
# This is a source file for mawk, an implementation of
# the AWK programming language.

12
mawk.h
View File

@ -1,6 +1,6 @@
/********************************************
mawk.h
copyright 2008-2016,2019 Thomas E. Dickey
copyright 2008-2019,2020 Thomas E. Dickey
copyright 1991-1995,1996 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: mawk.h,v 1.54 2019/02/02 01:00:14 tom Exp $
* $MawkId: mawk.h,v 1.55 2020/01/20 14:15:55 tom Exp $
*/
/* mawk.h */
@ -152,11 +152,13 @@ extern char *str_str(char *, size_t, const char *, size_t);
#endif
extern void parse(void);
extern int yylex(void);
extern int yyparse(void);
extern void yyerror(const char *);
extern void scan_cleanup(void);
#ifndef YYBYACC
extern int yylex(void);
#endif
extern void yyerror(const char *);
extern void bozo(const char *) GCC_NORETURN;
extern void errmsg(int, const char *,...) GCC_PRINTFLIKE(2,3);
extern void compile_error(const char *,...) GCC_PRINTFLIKE(1,2);

View File

@ -1,3 +1,9 @@
mawk-cur (1.3.4-20200120) unstable; urgency=low
* maintenance updates
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 19 Jan 2020 20:39:59 -0500
mawk-cur (1.3.4-20200106) unstable; urgency=low
* maintenance updates
@ -123,13 +129,13 @@ mawk-cur (1.3.4-20131226) unstable; urgency=low
mawk-cur (1.3.4-20130803) unstable; urgency=low
* miscelleneous bug-fixes
* miscellaneous bug-fixes
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 03 Aug 2013 09:29:37 -0400
mawk-cur (1.3.4-20130220) unstable; urgency=low
* miscelleneous bug-fixes
* miscellaneous bug-fixes
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 19 Feb 2013 06:45:33 -0500

View File

@ -1,8 +1,8 @@
Summary: mawk - pattern scanning and text processing language
%define AppProgram mawk
%define AppVersion 1.3.4
%define AppRelease 20200106
# $MawkId: mawk.spec,v 1.67 2020/01/06 10:15:35 tom Exp $
%define AppRelease 20200120
# $MawkId: mawk.spec,v 1.69 2020/01/20 11:21:53 tom Exp $
Name: %{AppProgram}
Version: %{AppVersion}
Release: %{AppRelease}

View File

@ -1419,7 +1419,7 @@ code_call_id(CA_REC * p, SYMTAB * ip)
static CELL dummy;
p->call_offset = code_offset;
/* This always get set now. So that fcall:relocate_arglist
/* This always gets set now. So that fcall:relocate_arglist
works. */
switch (ip->type) {

View File

@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: parse.y,v 1.21 2020/01/07 00:44:39 tom Exp $
* $MawkId: parse.y,v 1.23 2020/01/20 11:49:54 tom Exp $
*/
%{
@ -747,7 +747,7 @@ statement : array_loop_front statement
/* fields
D_ID is a special token , same as an ID, but yylex()
only returns it after a '$'. In essense,
only returns it after a '$'. In essence,
DOLLAR D_ID is really one token.
*/
@ -1337,7 +1337,7 @@ code_call_id(CA_REC * p, SYMTAB * ip)
static CELL dummy;
p->call_offset = code_offset;
/* This always get set now. So that fcall:relocate_arglist
/* This always gets set now. So that fcall:relocate_arglist
works. */
switch (ip->type) {

View File

@ -11,9 +11,9 @@ the GNU General Public License, version 2, 1991.
*/
/*
* $MawkId: patchlev.h,v 1.93 2020/01/06 10:02:42 tom Exp $
* $MawkId: patchlev.h,v 1.95 2020/01/20 11:21:53 tom Exp $
*/
#define PATCH_BASE 1
#define PATCH_LEVEL 3
#define PATCH_STRING ".4"
#define DATE_STRING "20200106"
#define DATE_STRING "20200120"

View File

@ -1,6 +1,6 @@
/********************************************
print.c
copyright 2008-2012,2016. Thomas E. Dickey
copyright 2008-2016,2020. Thomas E. Dickey
copyright 1991-1996,2014. Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: print.c,v 1.27 2016/09/27 09:29:19 tom Exp $
* $MawkId: print.c,v 1.28 2020/01/20 14:08:41 tom Exp $
*/
#include "mawk.h"
@ -274,8 +274,8 @@ make_sfmt(const char *format,
return success;
}
#define SprintfOverflow(buffer, need) \
if (buffer + need + 1 >= sprintf_limit) { \
#define SprintfOverflow(bfr, need) \
if (bfr + need + 1 >= sprintf_limit) { \
rt_overflow("sprintf buffer", \
(unsigned) (sprintf_limit - sprintf_buff)); \
}

View File

@ -1,6 +1,6 @@
/********************************************
rexp0.c
copyright 2008-2010,2016, Thomas E. Dickey
copyright 2008-2016,2020, Thomas E. Dickey
copyright 2010, Jonathan Nieder
copyright 1991-1994,1996, Michael D. Brennan
@ -12,7 +12,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: rexp0.c,v 1.33 2016/11/21 00:26:41 tom Exp $
* $MawkId: rexp0.c,v 1.34 2020/01/20 11:46:45 tom Exp $
*/
/* lexical scanner */
@ -729,7 +729,7 @@ store_bvp(BV * bvp)
bv_limit = bv_next + BV_GROWTH;
}
/* put bvp in bv_next as a sentinal */
/* put bvp in bv_next as a sentinel */
*bv_next = bvp;
p = bv_base;
while (memcmp(*p, bvp, sizeof(BV)))

10
rexp2.c
View File

@ -1,6 +1,6 @@
/********************************************
rexp2.c
copyright 2009-2016,2017, Thomas E. Dickey
copyright 2009-2017,2020, Thomas E. Dickey
copyright 2010, Jonathan Nieder
copyright 1991-1992,1993, Michael D. Brennan
@ -12,7 +12,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: rexp2.c,v 1.26 2017/10/17 01:19:15 tom Exp $
* $MawkId: rexp2.c,v 1.28 2020/01/20 15:11:15 tom Exp $
*/
/* test a string against a machine */
@ -24,7 +24,7 @@ the GNU General Public License, version 2, 1991.
RT_STATE *RE_run_stack_base;
RT_STATE *RE_run_stack_limit;
/* Large model DOS segment arithemetic breaks the current stack.
/* Large model DOS segment arithmetic breaks the current stack.
This hack fixes it without rewriting the whole thing, 5/31/91 */
RT_STATE *RE_run_stack_empty;
@ -373,7 +373,9 @@ REtest(char *str, /* string to test */
}
/* FALLTHRU */
CASE_UANY(M_2JB): /* take the jump branch */
case (M_2JB) + U_OFF: /* take the jump branch */
/* FALLTHRU */
case (M_2JB) + U_ON:
/* don't stack an ACCEPT */
if ((tm = m + 1)->s_type == M_ACCEPT) {
return 1;

12
rexp3.c
View File

@ -1,6 +1,6 @@
/********************************************
rexp3.c
copyright 2008-2016,2017, Thomas E. Dickey
copyright 2008-2017,2020, Thomas E. Dickey
copyright 2010, Jonathan Nieder
copyright 1991-1992,1993, Michael D. Brennan
@ -12,7 +12,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: rexp3.c,v 1.40 2017/10/17 01:19:15 tom Exp $
* $MawkId: rexp3.c,v 1.41 2020/01/20 15:16:04 tom Exp $
*/
/* match a string against a machine */
@ -391,15 +391,17 @@ REmatch(char *str, /* string to test */
m++;
RE_CASE();
CASE_UANY(M_2JC): /* take the jump branch if position changed */
case (M_2JC) + U_OFF: /* take the jump branch if position changed */
case (M_2JC) + U_ON:
/* see REtest */
if (RE_pos_pop(&sp, stackp) == s) {
m++;
RE_CASE();
}
/* FALLTHRU */
CASE_UANY(M_2JB): /* take the jump branch */
case (M_2JB) + U_OFF: /* take the jump branch */
/* FALLTHRU */
case (M_2JB) + U_ON:
push(m + 1, s, sp, ss, u_flag);
m += m->s_data.jump;
RE_CASE();

View File

@ -1,6 +1,6 @@
/********************************************
split.c
copyright 2008-2010,2014 Thomas E. Dickey
copyright 2008-2014,2020 Thomas E. Dickey
copyright 1991-1996,2014 Michael D. Brennan
This is a source file for mawk, an implementation of
@ -11,7 +11,7 @@ the GNU General Public License, version 2, 1991.
********************************************/
/*
* $MawkId: split.c,v 1.29 2014/09/14 21:35:23 tom Exp $
* $MawkId: split.c,v 1.30 2020/01/20 11:22:11 tom Exp $
* @Log: split.c,v @
* Revision 1.3 1996/02/01 04:39:42 mike
* dynamic array scheme
@ -168,7 +168,7 @@ re_pos_match(char *str, size_t str_len, PTR re, size_t *lenp, int no_bol)
return match;
} else {
/* match but zero length, move str forward and try again */
/* note this match must have occured at front of str */
/* note this match must have occurred at front of str */
str = match + 1;
no_bol = 1;
}

View File

@ -1,4 +1,4 @@
# $MawkId: wfrq0.awk,v 1.2 2010/12/10 17:00:00 tom Exp $
# $MawkId: wfrq0.awk,v 1.3 2020/01/20 11:52:06 tom Exp $
# Test-script for MAWK
###############################################################################
# copyright 1993, Michael D. Brennan
@ -10,7 +10,7 @@
# the GNU General Public License, version 2, 1991.
###############################################################################
# this program finds the twenty most freq
# this program finds the twenty most frequent
# words in document using a heap sort at the end
#
#
@ -63,7 +63,7 @@ for( i in cnt )
if ( ++j == 21 ) break ;
}
# make some sentinals
# make some sentinels
for( i = j ; i < 43 ; i++ ) heap[i] = BIG
h_empty = j # save the first empty slot