Skip to content

Commit d891895

Browse files
v1.0.10 (#96)
2 parents db9d3c4 + 3b30b71 commit d891895

File tree

8 files changed

+62
-35
lines changed

8 files changed

+62
-35
lines changed

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2023-04-28 OSS Consortium <[email protected]>
2+
3+
* opensource COBOL 4J v1.0.10 released.
4+
15
2023-03-31 OSS Consortium <[email protected]>
26

37
* opensource COBOL 4J v1.0.9 released.

NEWS

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
NEWS - user visible changes -*- outline -*-
22

3+
-----------------------------------------------------------------------
4+
5+
* opensource COBOL 4J 1.0.10
6+
7+
** Bug fixes
8+
(1) Fix a bug related to string literals containing specified multi-byte characters
9+
* For example, "十郎"
10+
11+
** Miscellaneous
12+
(1) Fix some tests
13+
14+
-----------------------------------------------------------------------
15+
316
* opensource COBOL 4J 1.0.9
417

518
** New Features

cobj/codegen.c

+16-8
Original file line numberDiff line numberDiff line change
@@ -420,48 +420,56 @@ static void joutput_indent(const char *str) {
420420
static void joutput_string(const unsigned char *s, int size) {
421421
int i;
422422
int c;
423+
int output_multibyte = 0;
423424
int printable = 1;
424425

425426
for (i = 0; i < size;) {
426427
c = s[i];
427-
if ((0x00 <= c && c <= 0x1F) || (c == 0x7F) || (c == 0x80) || (0xf0 <= c)) {
428-
printable = 0;
429-
break;
430-
} else if (i < size - 1 &&
431-
((0x81 <= c && c <= 0x9f) || (0xE0 <= c && c <= 0xEF))) {
428+
if (0x20 <= c && c <= 0x7e) {
429+
i += 1;
430+
} else if ((0x81 <= c && c <= 0x9f) || (0xe0 <= c && c <= 0xef)) {
432431
i += 2;
433432
} else {
434-
i += 1;
433+
printable = 0;
434+
break;
435435
}
436436
}
437437

438438
if (printable) {
439439
if (param_wrap_string_flag) {
440440
joutput("new CobolDataStorage(");
441441
}
442+
442443
joutput("\"");
444+
443445
for (i = 0; i < size; i++) {
444446
c = s[i];
445-
if (c == '\"' || c == '\\') {
447+
if (!output_multibyte && (c == '\"' || c == '\\')) {
446448
joutput("\\%c", c);
447-
} else if (c == '\n') {
449+
} else if (!output_multibyte && (c == '\n')) {
448450
joutput("\\n");
449451
} else {
450452
joutput("%c", c);
451453
}
454+
output_multibyte = !output_multibyte &&
455+
((0x81 <= c && c <= 0x9f) || (0xe0 <= c && c <= 0xef));
452456
}
457+
453458
joutput("\"");
459+
454460
if (param_wrap_string_flag) {
455461
joutput(")");
456462
}
457463
} else {
458464
joutput("makeCobolDataStorage(");
465+
459466
for (i = 0; i < size; i++) {
460467
joutput("(byte)0x%02x", s[i]);
461468
if (i < size - 1) {
462469
joutput(", ");
463470
}
464471
}
472+
465473
joutput(")");
466474
}
467475
}

configure

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.9.
3+
# Generated by GNU Autoconf 2.71 for opensource COBOL 4J 1.0.10.
44
#
55
# Report bugs to <[email protected]>.
66
#
@@ -620,9 +620,9 @@ MAKEFLAGS=
620620

621621
# Identity of this package.
622622
PACKAGE_NAME='opensource COBOL 4J'
623-
PACKAGE_TARNAME='opensource-cobol-4j-1.0.9'
624-
PACKAGE_VERSION='1.0.9'
625-
PACKAGE_STRING='opensource COBOL 4J 1.0.9'
623+
PACKAGE_TARNAME='opensource-cobol-4j-1.0.10'
624+
PACKAGE_VERSION='1.0.10'
625+
PACKAGE_STRING='opensource COBOL 4J 1.0.10'
626626
PACKAGE_BUGREPORT='[email protected]'
627627
PACKAGE_URL=''
628628

@@ -1414,7 +1414,7 @@ if test "$ac_init_help" = "long"; then
14141414
# Omit some internal or obsolete options to make the list less imposing.
14151415
# This message is too long to be a string in the A/UX 3.1 sh.
14161416
cat <<_ACEOF
1417-
\`configure' configures opensource COBOL 4J 1.0.9 to adapt to many kinds of systems.
1417+
\`configure' configures opensource COBOL 4J 1.0.10 to adapt to many kinds of systems.
14181418

14191419
Usage: $0 [OPTION]... [VAR=VALUE]...
14201420

@@ -1464,7 +1464,7 @@ Fine tuning of the installation directories:
14641464
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
14651465
--mandir=DIR man documentation [DATAROOTDIR/man]
14661466
--docdir=DIR documentation root
1467-
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.9]
1467+
[DATAROOTDIR/doc/opensource-cobol-4j-1.0.10]
14681468
--htmldir=DIR html documentation [DOCDIR]
14691469
--dvidir=DIR dvi documentation [DOCDIR]
14701470
--pdfdir=DIR pdf documentation [DOCDIR]
@@ -1486,7 +1486,7 @@ fi
14861486

14871487
if test -n "$ac_init_help"; then
14881488
case $ac_init_help in
1489-
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.9:";;
1489+
short | recursive ) echo "Configuration of opensource COBOL 4J 1.0.10:";;
14901490
esac
14911491
cat <<\_ACEOF
14921492

@@ -1617,7 +1617,7 @@ fi
16171617
test -n "$ac_init_help" && exit $ac_status
16181618
if $ac_init_version; then
16191619
cat <<\_ACEOF
1620-
opensource COBOL 4J configure 1.0.9
1620+
opensource COBOL 4J configure 1.0.10
16211621
generated by GNU Autoconf 2.71
16221622

16231623
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2105,7 +2105,7 @@ cat >config.log <<_ACEOF
21052105
This file contains any messages produced by compilers while
21062106
running configure, to aid debugging if configure makes a mistake.
21072107

2108-
It was created by opensource COBOL 4J $as_me 1.0.9, which was
2108+
It was created by opensource COBOL 4J $as_me 1.0.10, which was
21092109
generated by GNU Autoconf 2.71. Invocation command line was
21102110

21112111
$ $0$ac_configure_args_raw
@@ -3403,8 +3403,8 @@ fi
34033403

34043404

34053405
# Define the identity of the package.
3406-
PACKAGE='opensource-cobol-4j-1.0.9'
3407-
VERSION='1.0.9'
3406+
PACKAGE='opensource-cobol-4j-1.0.10'
3407+
VERSION='1.0.10'
34083408

34093409

34103410
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -25367,7 +25367,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2536725367
# report actual input values of CONFIG_FILES etc. instead of their
2536825368
# values after options handling.
2536925369
ac_log="
25370-
This file was extended by opensource COBOL 4J $as_me 1.0.9, which was
25370+
This file was extended by opensource COBOL 4J $as_me 1.0.10, which was
2537125371
generated by GNU Autoconf 2.71. Invocation command line was
2537225372

2537325373
CONFIG_FILES = $CONFIG_FILES
@@ -25435,7 +25435,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
2543525435
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2543625436
ac_cs_config='$ac_cs_config_escaped'
2543725437
ac_cs_version="\\
25438-
opensource COBOL 4J config.status 1.0.9
25438+
opensource COBOL 4J config.status 1.0.10
2543925439
configured by $0, generated by GNU Autoconf 2.71,
2544025440
with options \\"\$ac_cs_config\\"
2544125441

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
AC_PREREQ(2.59)
2121

22-
AC_INIT([opensource COBOL 4J],[1.0.9],[[email protected]],[opensource-cobol-4j-1.0.9])
22+
AC_INIT([opensource COBOL 4J],[1.0.10],[[email protected]],[opensource-cobol-4j-1.0.10])
2323
AC_CONFIG_SRCDIR([libcob.h])
2424
AC_CONFIG_HEADERS([config.h])
2525
AC_CONFIG_TESTDIR([tests])

libcobj/src/jp/osscons/opensourcecobol/libcobj/data/CobolDataStorage.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
*/
1919
package jp.osscons.opensourcecobol.libcobj.data;
2020

21+
import java.io.UnsupportedEncodingException;
2122
import java.nio.ByteBuffer;
2223
import java.nio.ByteOrder;
2324
import jp.osscons.opensourcecobol.libcobj.common.CobolModule;
@@ -180,7 +181,11 @@ public void memcpy(byte[] buf, int size) {
180181
* @param size
181182
*/
182183
public void memcpy(String str, int size) {
183-
this.memcpy(str.getBytes(), size);
184+
try {
185+
this.memcpy(str.getBytes("SJIS"), size);
186+
} catch (UnsupportedEncodingException e) {
187+
this.memcpy(str.getBytes(), size);
188+
}
184189
}
185190

186191
/**

tests/jp-compat.src/special-names.at

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
AT_SETUP([ACCEPT ARGUMENT-NUMBER])
2-
AT_CHECK([${SKIP_TEST}])
32

43
AT_DATA([prog.cob], [
54
IDENTIFICATION DIVISION.
@@ -17,7 +16,7 @@ AT_DATA([prog.cob], [
1716
STOP RUN.
1817
])
1918

20-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
19+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
2120
AT_CHECK([java prog this is arg], [0], [03])
2221

2322
AT_CLEANUP
@@ -42,13 +41,12 @@ AT_DATA([prog.cob], [
4241
STOP RUN.
4342
])
4443

45-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
44+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
4645
AT_CHECK([java prog this is arg], [0], [arg ])
4746

4847
AT_CLEANUP
4948

5049
AT_SETUP([ACCEPT ENVIRONMENT-VALUE])
51-
AT_CHECK([${SKIP_TEST}])
5250

5351
AT_DATA([prog.cob], [
5452
IDENTIFICATION DIVISION.
@@ -67,7 +65,7 @@ AT_DATA([prog.cob], [
6765
STOP RUN.
6866
])
6967

70-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
68+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
7169
AT_CHECK([export TESTENV=envvalue && java prog], [0], [envvalue])
7270

7371
AT_CLEANUP
@@ -92,13 +90,12 @@ AT_DATA([prog.cob], [
9290
STOP RUN.
9391
])
9492

95-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
93+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
9694
AT_CHECK([java prog this is arg], [0], [arg ])
9795

9896
AT_CLEANUP
9997

10098
AT_SETUP([DISPLAY ENVIRONMENT-NAME])
101-
AT_CHECK([${SKIP_TEST}])
10299

103100
AT_DATA([prog.cob], [
104101
IDENTIFICATION DIVISION.
@@ -117,7 +114,7 @@ AT_DATA([prog.cob], [
117114
STOP RUN.
118115
])
119116

120-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
117+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
121118
AT_CHECK([export TESTENV=envvalue && java prog], [0], [envvalue])
122119

123120
AT_CLEANUP
@@ -146,7 +143,7 @@ AT_DATA([prog.cob], [
146143
STOP RUN.
147144
])
148145

149-
AT_CHECK([${COMPILE_JP_COMPAT} -x prog.cob], [0])
146+
AT_CHECK([${COMPILE_JP_COMPAT} prog.cob], [0])
150147
AT_CHECK([export TESTENV=envvalue && java prog], [0], [envvalue:newvalue])
151148

152149
AT_CLEANUP

tests/package.m4

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Signature of the current package.
22
m4_define([AT_PACKAGE_NAME], [opensource COBOL 4J])
3-
m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.0.9])
4-
m4_define([AT_PACKAGE_VERSION], [1.0.9])
5-
m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.0.9])
3+
m4_define([AT_PACKAGE_TARNAME], [opensource-cobol-4j-1.0.10])
4+
m4_define([AT_PACKAGE_VERSION], [1.0.10])
5+
m4_define([AT_PACKAGE_STRING], [opensource COBOL 4J 1.0.10])
66
m4_define([AT_PACKAGE_BUGREPORT], [[email protected]])

0 commit comments

Comments
 (0)