* avoid bogus Attach header, containing directory of
   file being attached
 * simplify code, taking advantage of `readlink -f'.
---

Notes:
    This patch fixes bug, it is fact. Another fact is that there is no
    `readlink` utility in POSIX-2008. So questions are:

     * Are there any worthy systems, which are still in interactive use,
       and are lacking `readlink' utility?

     * Does `readlink' utility on systems other then GNU/Linux support
       option -f?

     * Why do we use deprecated `command substitution` syntax instead of
       modern $(syntax), which is in POSIX-2008?

 uip/whatnow2.sh | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/uip/whatnow2.sh b/uip/whatnow2.sh
index 89baf1f..5e65bd6 100755
--- a/uip/whatnow2.sh
+++ b/uip/whatnow2.sh
@@ -69,15 +69,6 @@ get_showproc()
        return
 }

-get_realpath()
-{
-       reldir=`dirname "$1"`
-       filename=`basename "$1"`
-       cd $reldir
-       echo "$PWD/$filename"
-       cd -
-}
-
 get_attachmentheader()
 {
        mhparam 'Attachment-Header'
@@ -183,7 +174,7 @@ attach()
                        echo "$@" 1>&2
                        exit 1
                fi
-               file=`get_realpath "$1"`
+               file=`readlink -f "$1"`
                anno -nodate -append -component $header -text "$file" $mhdraft
                shift
        done

Reply via email to