sfeed_update: leave IFS unchanged for sfeedrc code - sfeed - RSS and Atom parser
HTML git clone git://git.codemadness.org/sfeed
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 6dcce9a9e8e720aca89cf50e5f5def3ea9d57ca2
DIR parent 195cbb7aa51b7726c9a3cc0f5bcd5e34968a2907
HTML Author: Jeff Huffman <tejing@tejing.com>
Date: Fri, 6 Dec 2024 12:53:59 +0100
sfeed_update: leave IFS unchanged for sfeedrc code
IFS affects the word-splitting of unquoted variable expansions, which can cause
bugs that are very difficult to track down without in-depth shell knowledge.
Example of affected code:
prog ${var:+--opt "$var"}
Diffstat:
M sfeed_update | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
DIR diff --git a/sfeed_update b/sfeed_update
@@ -239,10 +239,9 @@ main() {
# process a single feed.
# parameters are: config, tmpdir, name, feedurl, basesiteurl, encoding
if [ "${SFEED_UPDATE_CHILD}" = "1" ]; then
- IFS="" # "\037"
[ "$1" = "" ] && exit 0 # must have an argument set
printf '%s\n' "$1" | \
- while read -r _config _tmpdir _name _feedurl _basesiteurl _encoding; do
+ while IFS="" read -r _config _tmpdir _name _feedurl _basesiteurl _encoding; do
loadconfig "${_config}"
sfeedtmpdir="${_tmpdir}"
_feed "${_name}" "${_feedurl}" "${_basesiteurl}" "${_encoding}"