Skip to content

Commit a204ddd

Browse files
authored
Merge pull request #21 from opensourcecobol/dev/y-sakamoto
SORT文のバグを修正した.
2 parents 05c6eeb + 9df77e3 commit a204ddd

File tree

4 files changed

+1
-8
lines changed

4 files changed

+1
-8
lines changed

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ Known bugs
4949

5050
* Cannot call inline programs.
5151
* Rewrite wrong data to indexed files with alternate keys in some cases.
52-
* Under some conditions, SORT statements produce wrong data.

README_JP.md

-1
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,3 @@ java [PROGRAM-ID]
4747

4848
* 同一ソースコード内の別プログラムのCALLができない.
4949
* ALTERNATE KEYが指定されたINDEXEDファイルに対するREWRITE文の不具合.
50-
* SORT文の結果が少数のケースにおいて不正になること.

libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolFile.java

-4
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,6 @@ public int open_(String filename, int mode, int sharing) throws IOException {
836836
}
837837

838838
public void close(int opt, AbstractCobolField fnstatus) {
839-
//時間計測
840-
//TODO 削除
841-
//end = System.currentTimeMillis();
842-
//System.out.println("" + (end - start) + "ms");
843839
String openMode = String.format("%02d", (int)this.last_open_mode);
844840
if(invokeFun(COB_IO_CLOSE, this, null, null, fnstatus, openMode, null, null) != 0) {
845841
this.last_open_mode = (char)Integer.parseInt(openMode);

libcobj/src/jp/osscons/opensourcecobol/libcobj/file/CobolFileSort.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ public static void sortGiving(CobolFile sort_file, int varcnt, CobolFile... fbas
753753
} else {
754754
opt = 0;
755755
}
756-
sort_file.record.setDataStorage(d);
756+
sort_file.record.getDataStorage().memcpy(d, sort_file.record.getSize());
757757
copyCheck(fbase[i], sort_file);
758758
fbase[i].write(fbase[i].record, opt, null);
759759
}
@@ -838,7 +838,6 @@ public static void performRelease(CobolFile f) {
838838
if (hp != null) {
839839
fnstatus = hp.getFnstatus();
840840
}
841-
842841
int ret = CobolFileSort.sortSubmit(f, f.record.getDataStorage());
843842
switch (ret) {
844843
case 0:

0 commit comments

Comments
 (0)