MainEXFile: Fix Col() to accept EX_LIST

MainEXFile.Col() returns the number of items for EX_LIST handles.

Also removed the FIXME comments from Row and Col since the semantics
appear correct.
This commit is contained in:
kichikuou
2026-04-10 14:29:20 +09:00
parent 1e29930f4c
commit 2bc9a3d2cb
+5 -2
View File
@@ -225,13 +225,16 @@ static int MainEXFile_RA2Handle(int handle, int row, struct string *format_name)
static int MainEXFile_Row(int handle)
{
struct ex_table *t = handle_to_table(handle);
return t ? t->nr_rows : 0; // FIXME: should this be nr_columns?
return t ? t->nr_rows : 0;
}
static int MainEXFile_Col(int handle)
{
if (handle > 0 && (unsigned)handle < nr_handles &&
handles[handle]->type == EX_LIST)
return handles[handle]->list->nr_items;
struct ex_table *t = handle_to_table(handle);
return t ? t->nr_columns : 0; // FIXME: should this be nr_rows?
return t ? t->nr_columns : 0;
}
static int MainEXFile_Type(int handle)