diff --git a/docs/changes.md b/docs/changes.md index 2f29d0f17..ed65ef53c 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -2,6 +2,8 @@ 2023/12/06 * fscript 增加 date\_time\_format + * 完善 fscript,先找全局函数,再找用户自定义的函数。 + * 完善 csv 路径解析。 2023/12/05 * 完善fscript部分数学函数。 diff --git a/src/csv/csv_file_object.c b/src/csv/csv_file_object.c index 02f6d4d99..c4aaa3346 100644 --- a/src/csv/csv_file_object.c +++ b/src/csv/csv_file_object.c @@ -68,10 +68,12 @@ static ret_t csv_path_parse(csv_path_t* path, csv_file_t* csv, const char* name) } if (*p == '[') { + return_value_if_fail(tk_isdigit(p[1]), RET_BAD_PARAMS); path->col = tk_atoi(p + 1); } else { path->col = csv_file_get_col_of_name(csv, p); if (path->col < 0) { + return_value_if_fail(tk_isdigit(p[0]), RET_BAD_PARAMS); path->col = tk_atoi(p); } }