X-Git-Url: https://projects.mako.cc/source/muttjump/blobdiff_plain/105994a8817e4d4618aad762506f8bba11b8ab18..7ee3d9bac7902c2dd763dc7acf1a1113c2f2f0d6:/muttjump diff --git a/muttjump b/muttjump index 53a44bb..38e8a02 100755 --- a/muttjump +++ b/muttjump @@ -63,10 +63,18 @@ function quote () { echo \'${1//\'/\'\\\'\'}\' } +function quote_regexp () { + echo "$1" | sed 's/[][\^.$|)(*+?}{]/\\&/g' +} + function is_callable () { type $1 >/dev/null 2>&1 } +function wc_L () { + awk '{ y = length(); if (y > x) x = y } END { print x }' +} + function usage () { cat >&2 <&2 2>&1 1>&3-) @@ -203,7 +211,8 @@ if [ ! -d "$orig_maildir/cur" ] ; then die "directory $(quote "$orig_maildir") doesn't exist or is no Maildir" fi -jump_expr="~i'$msgid'" +msgid_mutt=$(quote_regexp "$msgid_quoted") +jump_expr="~i'$msgid_mutt'" if [ "$MUTTJUMP_MULTI_SCREEN_MODE" = no ] ; then