Skip to content

Commit

Permalink
Merge SVN 3803, 3808, 3840, 3836
Browse files Browse the repository at this point in the history
  • Loading branch information
ddeclerck committed May 27, 2024
1 parent 26d1b49 commit 9c40e6c
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 15 deletions.
1 change: 0 additions & 1 deletion config/runtime.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions doc/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

* gnucobol.texi: remove node structuring that is identical to default

2020-09-28 James K. Lowden <[email protected]>

* cbrunt.tex.gen: Adjust for changed runtime.cfg.

2020-09-23 James K. Lowden <[email protected]>

* cbhelp.tex.gen: formatting improvements
Expand Down
28 changes: 17 additions & 11 deletions doc/cbrunt.tex.gen
Original file line number Diff line number Diff line change
Expand Up @@ -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{&}")
Expand Down Expand Up @@ -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: */, "") ) {
Expand All @@ -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
}

Expand Down
4 changes: 4 additions & 0 deletions libcob/ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -1423,6 +1423,10 @@

* common.c, common.h: removed support for VC older than VC 2008

2020-09-08 James K. Lowden <[email protected]>

* intrinsic.c (cob_intr_seconds_from_formatted_time): fix bug #886

2020-08-31 Simon Sobisch <[email protected]>

* strings.c: huge performance improvements for INSPECT by splitting
Expand Down
8 changes: 5 additions & 3 deletions libcob/intrinsic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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' };
Expand All @@ -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;
}
Expand Down

0 comments on commit 9c40e6c

Please sign in to comment.