Skip to content

Commit 163badc

Browse files
committed
Fixed an error when MOVE to NATIONAL item (not DISPLAY)
1 parent a3a4deb commit 163badc

File tree

1 file changed

+20
-13
lines changed

1 file changed

+20
-13
lines changed

libcob/move.c

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,19 +1859,6 @@ cob_move (cob_field *src_in, cob_field *dst)
18591859
return;
18601860
}
18611861

1862-
if (COB_FIELD_TYPE (src) != COB_TYPE_GROUP) {
1863-
if ((!(COB_FIELD_TYPE (src) == COB_TYPE_NATIONAL ||
1864-
COB_FIELD_TYPE (src) == COB_TYPE_NATIONAL_EDITED)) &&
1865-
(COB_FIELD_TYPE (dst) == COB_TYPE_NATIONAL ||
1866-
COB_FIELD_TYPE (dst) == COB_TYPE_NATIONAL_EDITED)) {
1867-
pTmp = judge_hankakujpn_exist (src, dst, &size);
1868-
if (pTmp != NULL) {
1869-
src->data = (unsigned char *)pTmp;
1870-
src->size = size;
1871-
}
1872-
}
1873-
}
1874-
18751862
/* Non-elementary move */
18761863
if (COB_FIELD_TYPE (src) == COB_TYPE_GROUP
18771864
|| COB_FIELD_TYPE (dst) == COB_TYPE_GROUP) {
@@ -1927,9 +1914,19 @@ cob_move (cob_field *src_in, cob_field *dst)
19271914
return;
19281915
}
19291916
case COB_TYPE_NATIONAL:
1917+
pTmp = judge_hankakujpn_exist (src, dst, &size);
1918+
if (pTmp != NULL) {
1919+
src->data = (unsigned char *)pTmp;
1920+
src->size = size;
1921+
}
19301922
cob_move_alphanum_to_national (src, dst);
19311923
return;
19321924
case COB_TYPE_NATIONAL_EDITED:
1925+
pTmp = judge_hankakujpn_exist (src, dst, &size);
1926+
if (pTmp != NULL) {
1927+
src->data = (unsigned char *)pTmp;
1928+
src->size = size;
1929+
}
19331930
cob_move_alphanum_to_national_edited (src, dst);
19341931
return;
19351932
default:
@@ -2269,9 +2266,19 @@ cob_move (cob_field *src_in, cob_field *dst)
22692266
cob_move_alphanum_to_edited (src, dst);
22702267
return;
22712268
case COB_TYPE_NATIONAL_EDITED:
2269+
pTmp = judge_hankakujpn_exist (src, dst, &size);
2270+
if (pTmp != NULL) {
2271+
src->data = (unsigned char *)pTmp;
2272+
src->size = size;
2273+
}
22722274
cob_move_alphanum_to_national_edited (src, dst);
22732275
break;
22742276
case COB_TYPE_NATIONAL:
2277+
pTmp = judge_hankakujpn_exist (src, dst, &size);
2278+
if (pTmp != NULL) {
2279+
src->data = (unsigned char *)pTmp;
2280+
src->size = size;
2281+
}
22752282
cob_move_alphanum_to_national (src, dst);
22762283
break;
22772284
default:

0 commit comments

Comments
 (0)