diff --git a/config/runtime.cfg b/config/runtime.cfg index 6e70396f7..933faa719 100644 --- a/config/runtime.cfg +++ b/config/runtime.cfg @@ -80,7 +80,6 @@ # If you want to *slightly* speed up a program's startup time, remove all # of the comments from the actual real configuration file that is processed. -## # ## General environment diff --git a/doc/ChangeLog b/doc/ChangeLog index da8594211..fdcc1d577 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -16,6 +16,10 @@ * gnucobol.texi: remove node structuring that is identical to default +2020-09-28 James K. Lowden + + * cbrunt.tex.gen: Adjust for changed runtime.cfg. + 2020-09-23 James K. Lowden * cbhelp.tex.gen: formatting improvements diff --git a/doc/cbrunt.tex.gen b/doc/cbrunt.tex.gen index d0cf4e8b4..b88d310ec 100755 --- a/doc/cbrunt.tex.gen +++ b/doc/cbrunt.tex.gen @@ -24,17 +24,27 @@ gsub(/\r/, "") } -/^## General instructions/,/^##$/ { +# The first section, "General instructions", gets special treatment. +# The others, starting with "General environment", simply get a section +# heading and verbatim quotation. + +/^## General instructions/,/^## General environment/ { + + if( debug ) { printf "@c input: %3d: %s\n", NR, $0 } - if( debug ) { print "@c input:", NR, $0 } if( sub(/^## /, "@section ") ) { - $0 = $0 "\n" + verbatim = "" + if( /General environment$/ ) { + section = 1 + verbatim = "\n@verbatim" + } + $0 = $0 verbatim "\n" print next } sub(/^# |^#$/, "") - gsub(/[{}]/, "@&") # escape literal square brackets. + gsub(/[{}]/, "@&") # escape literal braces as @{ and @}. # mark up plain text references gsub(/runtime.cfg/, "@file{&}") @@ -66,7 +76,7 @@ gsub(/kilo|mega|giga/, "@samp{&}") } - if( debug ) { print "@c marked up:", NR, $0 } + if( debug ) { printf "@c marked:%3d: %s\n", NR, $0 } # Wrap 1-line examples in "code{...}" if( sub(/^ *Example: */, "") ) { @@ -77,12 +87,8 @@ next } - if( /^##$/ ) { - section = 1 - } else { - print - } - if( debug ) { print "@c output:", NR, $0 } + if( debug ) { printf "@c output:%3d: %s\n", NR, $0 } + print next } diff --git a/libcob/ChangeLog b/libcob/ChangeLog index 53a03e0fc..7734fa8fb 100644 --- a/libcob/ChangeLog +++ b/libcob/ChangeLog @@ -1423,6 +1423,10 @@ * common.c, common.h: removed support for VC older than VC 2008 +2020-09-08 James K. Lowden + + * intrinsic.c (cob_intr_seconds_from_formatted_time): fix bug #886 + 2020-08-31 Simon Sobisch * strings.c: huge performance improvements for INSPECT by splitting diff --git a/libcob/intrinsic.c b/libcob/intrinsic.c index 89bf0f97e..d5f8b44f5 100644 --- a/libcob/intrinsic.c +++ b/libcob/intrinsic.c @@ -5603,7 +5603,8 @@ cob_field * cob_intr_seconds_from_formatted_time (cob_field *format_field, cob_field *time_field) { size_t str_length; - char format_str[COB_DATETIMESTR_LEN] = { '\0' }; + char format_str[2 * COB_DATETIMESTR_LEN] = { '\0' }; + char * time_format_str = format_str; const char decimal_point = COB_MODULE_PTR->decimal_point; int is_datetime = 0; char time_str[COB_DATETIMESTR_LEN] = { '\0' }; @@ -5625,14 +5626,15 @@ cob_intr_seconds_from_formatted_time (cob_field *format_field, cob_field *time_f /* Extract the time part of the strings */ if (is_datetime) { - split_around_t (format_str, NULL, format_str); + time_format_str = format_str + sizeof(format_str) / 2; + split_around_t (format_str, NULL, time_format_str); split_around_t ((char *) time_field->data, NULL, time_str); } else { memcpy (time_str, time_field->data, str_length); } /* Validate the formatted time */ - time_fmt = parse_time_format_string (format_str); + time_fmt = parse_time_format_string (time_format_str); if (test_formatted_time (time_fmt, time_str, decimal_point) != 0) { goto invalid_args; }