diff options
author | Robin Jarry <robin@jarry.cc> | 2022-10-21 13:58:15 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-23 20:51:02 +0200 |
commit | 9d71da175ace4a0efae0449d8667ed4dba585e90 (patch) | |
tree | 42f0f1c80abaab8d9c642e451fecf44f55e55221 /.gitignore | |
parent | 8e37d16a32ee89260e9dbf7bd04c0e91e135cfbe (diff) | |
download | aerc-9d71da175ace4a0efae0449d8667ed4dba585e90.tar.gz |
colorize: make it compatible with BSD awk
Fix the following error seen on MacOS:
/usr/bin/awk: syntax error at source line 22 source file
header_pattern = >>> @ <<< /^[A-Z][[:alnum:]-]+:/
The @ character in front of regular expressions to pre-compile them
seems not in the POSIX specification. Replace them with regular strings
and call match() instead of the ~ operator.
Also, adjust the url_pattern expression for BSD awk which explicitly
states:
The awk utility is compliant with the IEEE Std 1003.1-2008 (“POSIX.1”)
specification, except awk does not support {n,m} pattern matching.
Use [[:lower:]]+ instead of [a-z]{2,6}.
Tested with:
GNU Awk 5.1.1
awk version 20121220 (FreeBSD)
Link: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
Fixes: https://todo.sr.ht/~rjarry/aerc/96
Signed-off-by: Robin Jarry <robin@jarry.cc>
Acked-by: Koni Marti <koni.marti@gmail.com>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions