From 7f53b585f91fca7a8a5f97b4bf7c0e4e8363d0dd Mon Sep 17 00:00:00 2001 From: ado Date: Sat, 2 Mar 2024 00:34:19 +0100 Subject: [PATCH] Remove usage of ftell when updating cursor position value --- CMakeLists.txt | 2 +- include/ss/common.hpp | 2 +- meson.build | 2 +- ssp.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01df5e5..2a6af81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14) project( ssp - VERSION 1.7.1 + VERSION 1.7.2 DESCRIPTION "csv parser" HOMEPAGE_URL "https://github.com/red0124/ssp" LANGUAGES CXX diff --git a/include/ss/common.hpp b/include/ss/common.hpp index a844a4b..c70230e 100644 --- a/include/ss/common.hpp +++ b/include/ss/common.hpp @@ -129,7 +129,7 @@ std::tuple get_line(char*& buffer, size_t& buffer_size, ssize_t ssize; if (file) { ssize = get_line_file(buffer, buffer_size, file); - curr_char = std::ftell(file); + curr_char += ssize; } else { ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer, csv_data_size, curr_char); diff --git a/meson.build b/meson.build index 2d60c47..2ed28f9 100644 --- a/meson.build +++ b/meson.build @@ -6,7 +6,7 @@ project( 'cpp_std=c++17', 'buildtype=debugoptimized', 'wrap_mode=forcefallback'], - version: '1.7.1', + version: '1.7.2', meson_version:'>=0.54.0') fast_float_dep = dependency('fast_float') diff --git a/ssp.hpp b/ssp.hpp index b0c4b1b..811a490 100644 --- a/ssp.hpp +++ b/ssp.hpp @@ -741,7 +741,7 @@ std::tuple get_line(char*& buffer, size_t& buffer_size, ssize_t ssize; if (file) { ssize = get_line_file(buffer, buffer_size, file); - curr_char = std::ftell(file); + curr_char += ssize; } else { ssize = get_line_buffer(buffer, buffer_size, csv_data_buffer, csv_data_size, curr_char);