The delimiter character isn't special in character square brackets,
and neither is the backslash. So '\-\' means just a range of backslash
to backslash, and the minus sign isn't included at all.
Substitution tested with GNU Solaris 9 sed programs.
Originally noticed by Kristoffer Grundstr?m.
Bug-Debian: https://bugs.debian.org/754057
quote() {
case "$1" in
'') echo "''" ;;
- *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_\-\/]\)/\\\1/g' ;;
+ *) echo "$1" | sed 's/\([^a-zA-Z0-9.:_/-]\)/\\\1/g' ;;
esac
}