$OpenBSD: patch-shell_source_unix_misc_senddoc_sh,v 1.1 2017/07/04 08:17:55 robert Exp $

Index: shell/source/unix/misc/senddoc.sh
--- shell/source/unix/misc/senddoc.sh.orig
+++ shell/source/unix/misc/senddoc.sh
@@ -375,7 +375,7 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
             esac
             shift;
         done
-        /usr/bin/open -a "${MAILER}" ${ATTACH}
+        ${LOCALBASE}/bin/open -a "${MAILER}" ${ATTACH}
         ;;
 
     *)
@@ -384,15 +384,15 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
         # Try to be smart, and send the mail anyway, if we have the
         # possibility to do so.
 
-        if [ -x /usr/bin/xdg-email ] ; then
-            MAILER=/usr/bin/xdg-email
+        if [ -x ${LOCALBASE}/bin/xdg-email ] ; then
+            MAILER=${LOCALBASE}/bin/xdg-email
         elif [ -n "$DESKTOP_LAUNCH" ]; then
             # http://lists.freedesktop.org/pipermail/xdg/2004-August/002873.html
             MAILER=${DESKTOP_LAUNCH}
-        elif [ -n "$KDE_FULL_SESSION" -a -x /usr/bin/kde-open ] ; then
-            MAILER=/usr/bin/kde-open
-        elif [ -x /usr/bin/xdg-open ] ; then
-            MAILER=/usr/bin/xdg-open
+        elif [ -n "$KDE_FULL_SESSION" -a -x ${LOCALBASE}/bin/kde-open ] ; then
+            MAILER=${LOCALBASE}/bin/kde-open
+        elif [ -x ${LOCALBASE}/bin/xdg-open ] ; then
+            MAILER=${LOCALBASE}/bin/xdg-open
         else
             echo "Unsupported mail client: `basename $MAILER | sed 's/-.*^//'`"
             exit 2
@@ -425,7 +425,7 @@ case `basename "$MAILER" | sed 's/-.*$//'` in
                     shift
                     ;;
                 --attach)
-                    if [ "$MAILER" = "/usr/bin/xdg-email" ]; then
+                    if [ "$MAILER" = "${LOCALBASE}/bin/xdg-email" ]; then
                         MAILTO="${MAILTO:-}${MAILTO:+&}attach="`echo "file://$2" | "${URI_ENCODE}"`
                     else
                         MAILTO="${MAILTO:-}${MAILTO:+&}attachment="`echo "file://$2" | "${URI_ENCODE}"`
