Remove usage of ftell when updating cursor position value

This commit is contained in:
ado 2024-03-02 00:34:19 +01:00
parent 67ef6651c1
commit 7f53b585f9
4 changed files with 4 additions and 4 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14)
project( project(
ssp ssp
VERSION 1.7.1 VERSION 1.7.2
DESCRIPTION "csv parser" DESCRIPTION "csv parser"
HOMEPAGE_URL "https://github.com/red0124/ssp" HOMEPAGE_URL "https://github.com/red0124/ssp"
LANGUAGES CXX LANGUAGES CXX

View File

@ -129,7 +129,7 @@ std::tuple<ssize_t, bool> get_line(char*& buffer, size_t& buffer_size,
ssize_t ssize; ssize_t ssize;
if (file) { if (file) {
ssize = get_line_file(buffer, buffer_size, file); ssize = get_line_file(buffer, buffer_size, file);
curr_char = std::ftell(file); curr_char += ssize;
} else { } else {
ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer, ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer,
csv_data_size, curr_char); csv_data_size, curr_char);

View File

@ -6,7 +6,7 @@ project(
'cpp_std=c++17', 'cpp_std=c++17',
'buildtype=debugoptimized', 'buildtype=debugoptimized',
'wrap_mode=forcefallback'], 'wrap_mode=forcefallback'],
version: '1.7.1', version: '1.7.2',
meson_version:'>=0.54.0') meson_version:'>=0.54.0')
fast_float_dep = dependency('fast_float') fast_float_dep = dependency('fast_float')

View File

@ -741,7 +741,7 @@ std::tuple<ssize_t, bool> get_line(char*& buffer, size_t& buffer_size,
ssize_t ssize; ssize_t ssize;
if (file) { if (file) {
ssize = get_line_file(buffer, buffer_size, file); ssize = get_line_file(buffer, buffer_size, file);
curr_char = std::ftell(file); curr_char += ssize;
} else { } else {
ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer, ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer,
csv_data_size, curr_char); csv_data_size, curr_char);