X-Git-Url: https://git.madduck.net/etc/mailfilter.git/blobdiff_plain/a61350bc7ddd403460f79498a48e07f101fc2067..ce695b5f37533916b1d13761095da0fdc112d39f:/procmail/sql-escape diff --git a/procmail/sql-escape b/procmail/sql-escape index 08d0903..02c090a 100644 --- a/procmail/sql-escape +++ b/procmail/sql-escape @@ -1,13 +1,13 @@ -SQ="'\\''" -SQE="'\\\''" - :0 * DATA ?? . { + # 1. replace ' with '' + # 2. add quotes to each line + # 3. swap comma outside DATA="`echo \"$DATA\" \ - | sed -re 's,'\'','$SQE$SQE',g;' \ - -e 's/^.*$/'\$SQE'&'\$SQE'/' \ - -e 's/,'$SQE'$/'\$SQE',/'`" + | sed -re \"s,','',g\" \ + -e \"s/^.*$/'&'/\" \ + -e \"s/,'$/',/\"`" } :0 E