From e3598fce8cb51b7b1e36941a9e5bd79930ce0cf8 Mon Sep 17 00:00:00 2001 From: Aaron Fiore Date: Tue, 17 Mar 2026 14:06:45 -0700 Subject: [PATCH] container: hledger-flow: lib_preprocess: bash quote given column(s) when testing header. --- container/src/hledger-flow/lib/lib_preprocess.bash | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/container/src/hledger-flow/lib/lib_preprocess.bash b/container/src/hledger-flow/lib/lib_preprocess.bash index 9a8d7f8..5ac819c 100755 --- a/container/src/hledger-flow/lib/lib_preprocess.bash +++ b/container/src/hledger-flow/lib/lib_preprocess.bash @@ -2,7 +2,7 @@ # docker-finance | modern accounting for the power-user # -# Copyright (C) 2021-2025 Aaron Fiore (Founder, Evergreen Crypto LLC) +# Copyright (C) 2021-2026 Aaron Fiore (Founder, Evergreen Crypto LLC) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -66,7 +66,8 @@ function lib_preprocess::test_header() local _column="$1" local _header _header="$(lib_preprocess::__sanitize_header $2)" - [[ "$_header" =~ (^${_column}$|^${_column},|,${_column},|,${_column}$) ]] && return 0 || return 2 + # TODO: add custom delim + [[ "$_header" =~ (^"${_column}"$|^"${_column}",|,"${_column}",|,"${_column}"$) ]] && return 0 || return 2 } # Assert header in given CSV header