aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2013-12-19 23:11:03 +0200
committerArnold D. Robbins <arnold@skeeve.com>2013-12-19 23:11:03 +0200
commit1f502d9a39c5b3b3df1b943fcae79b162a7ea74d (patch)
tree0e38d248e036ff3ec569a4ed6c50169a04f2e9a0
parent4ea6e0780fbbd34d2f0d8e6b43c15c14d28b5d55 (diff)
parent477cb50c4c5b9e13e745a8e1413d532e27383d66 (diff)
downloadegawk-1f502d9a39c5b3b3df1b943fcae79b162a7ea74d.tar.gz
egawk-1f502d9a39c5b3b3df1b943fcae79b162a7ea74d.tar.bz2
egawk-1f502d9a39c5b3b3df1b943fcae79b162a7ea74d.zip
Merge branch 'gawk-4.1-stable' into new-vms
-rw-r--r--ChangeLog11
-rw-r--r--NEWS6
-rw-r--r--awk.h4
-rw-r--r--configh.in6
-rwxr-xr-xconfigure19
-rw-r--r--configure.ac1
-rw-r--r--helpers/ChangeLog4
-rwxr-xr-xhelpers/do.outline102
-rw-r--r--regexec.c2
9 files changed, 123 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ab202ae..fb6f6c0d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2013-12-19 Arnold D. Robbins <arnold@skeeve.com>
+
+ * regexec.c (re_search_internal): Make sure `dfa' pointer is
+ not NULL before trying to dereference it.
+
+2013-12-16 Arnold D. Robbins <arnold@skeeve.com>
+
+ * configure.ac (AC_FUNC_VPRINTF): Remove. Not needed on current
+ systems.
+ * awk.h (HAVE_VPRINTF): Remove check.
+
2013-12-12 John E. Malmberg <wb8tyw@qsl.net>
* io.c (redirect): Add additional VMS error codes.
diff --git a/NEWS b/NEWS
index 7454e156..26bf30c3 100644
--- a/NEWS
+++ b/NEWS
@@ -19,7 +19,11 @@ Changes from 4.1.0 to 4.1.1
5. The debugger now lists source code correctly under Cygwin.
-6. The -O option now works again.
+6. Configuration and building Mac OS X libreadline should work now.
+
+7. The -O option now works again.
+
+8. The --include option, documented since 4.0, now actually works.
XXX. A number of bugs have been fixed. See the ChangeLog.
diff --git a/awk.h b/awk.h
index 469d6b63..1414358c 100644
--- a/awk.h
+++ b/awk.h
@@ -180,10 +180,6 @@ typedef int off_t;
#define O_BINARY 0
#endif
-#ifndef HAVE_VPRINTF
-#error "you lose: you need a system with vfprintf"
-#endif /* HAVE_VPRINTF */
-
#ifndef HAVE_SETLOCALE
#define setlocale(locale, val) /* nothing */
#endif /* HAVE_SETLOCALE */
diff --git a/configh.in b/configh.in
index a535fd4b..bfffd853 100644
--- a/configh.in
+++ b/configh.in
@@ -42,9 +42,6 @@
*/
#undef HAVE_DECL_TZNAME
-/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
-#undef HAVE_DOPRNT
-
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -296,9 +293,6 @@
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
-/* Define to 1 if you have the `vprintf' function. */
-#undef HAVE_VPRINTF
-
/* Define to 1 if you have the <wchar.h> header file. */
#undef HAVE_WCHAR_H
diff --git a/configure b/configure
index a9217e0d..5959d02f 100755
--- a/configure
+++ b/configure
@@ -8980,25 +8980,6 @@ fi
-for ac_func in vprintf
-do :
- ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf"
-if test "x$ac_cv_func_vprintf" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF 1
-_ACEOF
-
-ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt"
-if test "x$ac_cv_func__doprnt" = xyes; then :
-
-$as_echo "#define HAVE_DOPRNT 1" >>confdefs.h
-
-fi
-
-fi
-done
-
-
diff --git a/configure.ac b/configure.ac
index 28d4f7d8..02267978 100644
--- a/configure.ac
+++ b/configure.ac
@@ -247,7 +247,6 @@ dnl Check for C11 _Noreturn
GAWK_AC_NORETURN
dnl checks for functions
-AC_FUNC_VPRINTF
AC_FUNC_MKTIME
case "$ac_cv_func_working_mktime" in
yes) AC_DEFINE(HAVE_MKTIME, 1, [we have the mktime function])
diff --git a/helpers/ChangeLog b/helpers/ChangeLog
index 4b720787..a43fcd0c 100644
--- a/helpers/ChangeLog
+++ b/helpers/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-12 Arnold D. Robbins <arnold@skeeve.com>
+
+ * do.outline: New file.
+
2013-06-27 Arnold D. Robbins <arnold@skeeve.com>
* ChangeLog: Created.
diff --git a/helpers/do.outline b/helpers/do.outline
new file mode 100755
index 00000000..203d27ad
--- /dev/null
+++ b/helpers/do.outline
@@ -0,0 +1,102 @@
+#! /usr/local/bin2/gawk -f
+
+# do.outline --- produce an outline of a texinfo document
+
+BEGIN {
+ # manifest constants
+ TRUE = 1
+ FALSE = 0
+
+ # Levels at which different nodes can be
+ Level["@top"] = 0
+ Level["@appendix"] = 1
+ Level["@chapter"] = 1
+ Level["@majorheading"] = 1
+ Level["@unnumbered"] = 1
+ Level["@preface"] = 1
+ Level["@appendixsec"] = 2
+ Level["@heading"] = 2
+ Level["@section"] = 2
+ Level["@unnumberedsec"] = 2
+ Level["@unnumberedsubsec"] = 3
+ Level["@appendixsubsec"] = 3
+ Level["@subheading"] = 3
+ Level["@subsection"] = 3
+ Level["@appendixsubsubsec"] = 4
+ Level["@subsubheading"] = 4
+ Level["@subsubsection"] = 4
+ Level["@unnumberedsubsubsec"] = 4
+
+ ah = bh = ch = 0
+
+ appendix = 0
+}
+
+/^@ignore/ && Pass == 1, /^@end[ \t]+ignore/ && Pass == 1 {
+ next
+}
+
+
+$1 in Level {
+ # save type
+ type = $1
+
+ lev = Level[$1]
+
+ if (lev == 1 && tolower($0) !~ /preface|foreword/) {
+ if ($1 == "@appendix") {
+ appendix = next_appendix(appendix)
+ ah = appendix
+ } else
+ ah++
+ bh = ch = dh = 0
+ } else if (lev == 2) {
+ bh++
+ ch = dh = 0
+ } else if (lev == 3) {
+ ch++
+ dh = 0
+ } else if (lev == 4)
+ dh++
+
+ Unnumbered = ($1 ~ /^@unnumbered/)
+
+ $1 = ""
+ $0 = preprocess($0)
+
+ for (i = 1; i < lev; i++)
+ printf "\t"
+
+ if (! Unnumbered) {
+ printf("%s.", ah)
+ if (bh)
+ printf("%d.", bh)
+ if (ch)
+ printf("%d.", ch)
+ if (dh)
+ printf("%d.", dh)
+ }
+
+ printf("%s\n", $0)
+}
+
+function preprocess(record)
+{
+ record = gensub(/@(code|command|samp|env)\{([^\}]+)\}/, "\\2", "g", record)
+ record = gensub(/@dots\{\}/, "...", "g", record)
+
+ return record
+}
+
+function next_appendix(cur, ind, letters)
+{
+ if (cur == 0)
+ return "A" # first time
+
+ letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ ind = index(letters, cur)
+ if (ind > 0 && ind <= 26)
+ return substr(letters, ++ind, 1)
+
+ return "Z"
+}
diff --git a/regexec.c b/regexec.c
index a39e1f58..77795f69 100644
--- a/regexec.c
+++ b/regexec.c
@@ -664,7 +664,7 @@ re_search_internal (preg, string, length, start, range, stop, nmatch, pmatch,
nmatch -= extra_nmatch;
/* Check if the DFA haven't been compiled. */
- if (BE (preg->used == 0 || dfa->init_state == NULL
+ if (BE (preg->used == 0 || dfa == NULL || dfa->init_state == NULL
|| dfa->init_state_word == NULL || dfa->init_state_nl == NULL
|| dfa->init_state_begbuf == NULL, 0))
return REG_NOMATCH;