summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2026-02-12 10:21:50 +0100
committerRemi Collet <remi@php.net>2026-02-12 10:21:50 +0100
commit957786b3ac0c44de03fecafae102877b8835b3a7 (patch)
tree72aaeafb58d9bf00e94e9f845158d99d626d6740
parentcd0ef91b325e8a8915a88fbde3aed33ba966b642 (diff)
fix unused-but-set-variable using patch fromHEADmaster
https://gitlab.com/Girgias/csv-php-extension/-/merge_requests/20
-rw-r--r--0001-Fix-unused-but-set-variable.patch40
-rw-r--r--php-girgias-csv.spec11
2 files changed, 49 insertions, 2 deletions
diff --git a/0001-Fix-unused-but-set-variable.patch b/0001-Fix-unused-but-set-variable.patch
new file mode 100644
index 0000000..1885743
--- /dev/null
+++ b/0001-Fix-unused-but-set-variable.patch
@@ -0,0 +1,40 @@
+From 0345e17e4d8d42e0b6876d4d88a9ee4c88abf567 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Thu, 12 Feb 2026 10:14:49 +0100
+Subject: [PATCH] Fix unused-but-set-variable
+
+---
+ csv.c | 3 ---
+ 1 file changed, 3 deletions(-)
+
+diff --git a/csv.c b/csv.c
+index 9d6f778..6f7ece6 100644
+--- a/csv.c
++++ b/csv.c
+@@ -382,7 +382,6 @@ static HashTable* rfc4180_string_to_hashtable(
+ ZEND_ASSERT(row < end_buffer);
+
+ smart_str field_value = {0};
+- size_t field_value_length = 0;
+
+ /* Main loop to "tokenize" the row */
+ while (row < end_buffer) {
+@@ -431,7 +430,6 @@ static HashTable* rfc4180_string_to_hashtable(
+
+ smart_str_free(&field_value);
+
+- field_value_length = 0;
+ at_start_of_field = true;
+ continue;
+ }
+@@ -453,7 +451,6 @@ static HashTable* rfc4180_string_to_hashtable(
+ consume:
+ at_start_of_field = false;
+ smart_str_appendc(&field_value, row[0]);
+- field_value_length++;
+ row++;
+ }
+
+--
+2.53.0
+
diff --git a/php-girgias-csv.spec b/php-girgias-csv.spec
index e16d989..283c33d 100644
--- a/php-girgias-csv.spec
+++ b/php-girgias-csv.spec
@@ -1,6 +1,6 @@
# remirepo spec file for php-girgias-csv
#
-# SPDX-FileCopyrightText: Copyright 2025 Remi Collet
+# SPDX-FileCopyrightText: Copyright 2025-2026 Remi Collet
# SPDX-License-Identifier: CECILL-2.1
# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
#
@@ -32,11 +32,13 @@ Summary: CSV PHP extension
Name: %{?scl_prefix}php-%{pie_vend}-%{pie_proj}
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
%forgemeta
-Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
License: PHP-3.01
URL: %{forgeurl}
Source0: %{forgesource}
+Patch0: 0001-Fix-unused-but-set-variable.patch
+
BuildRequires: make
BuildRequires: gcc
BuildRequires: (%{?scl_prefix}php-devel >= 8.0 with %{?scl_prefix}php-devel < 8.6)
@@ -63,6 +65,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%forgesetup
+%patch -P0 -p1
# see https://gitlab.com/Girgias/csv-php-extension/-/issues/13
sed -e '/PHP_CSV_VERSION/s/0.5.0/%{upstream_version}%{?upstream_prever}/' -i php_csv.h
@@ -125,6 +128,10 @@ TEST_PHP_ARGS="-n -d extension=%{buildroot}/%{php_extdir}/%{ext_name}.so" \
%changelog
+* Thu Feb 12 2026 Remi Collet <remi@remirepo.net> - 0.4.4-2
+- fix unused-but-set-variable using patch from
+ https://gitlab.com/Girgias/csv-php-extension/-/merge_requests/20
+
* Thu Sep 4 2025 Remi Collet <remi@remirepo.net> - 0.4.4-1
- initial package
- obsoletes php-pecl-csv