>>>>> "Alexandre" == Alexandre Oliva <[EMAIL PROTECTED]> writes:

Alexandre> The patch is fine

Applied.

Alexandre> I'm not 100% sure about its portability, though.

There is nothing risky, IMHO, in there.

Some more work will be needed.

src/ace/patches % cat /tmp/dirname.sh                            nostromo 10:38
#! /bin/sh

format="%12s %12s %12s %12s %12s\n"

# autoconf, alexandre, texi2dvi, GNU dirname
printf "$format" "" ac al tx dn

for dir in //tmp /tmp ./tmp ../../here //tmp/ /tmp/ ./tmp/ ../../here/
do
  ac=`echo $dir | sed 's%/[^/][^/]*$%%'`
  al=`echo $dir | sed '/^\/*$/!s%//*$%%;s%[^/]*$%%;/^\/*$/!s%//*$%%'`
  tx=`echo $dir | sed 's!/[^/]*$!!;s!^$!.!'`
  dn=`command dirname $dir`
  printf "$format" "$dir" "$ac" "$al" "$tx" "$dn"
done
src/ace/patches % sh /tmp/dirname.sh                             nostromo 10:38
                       ac           al           tx           dn
       //tmp            /           //            /            /
        /tmp                         /            .            /
       ./tmp            .            .            .            .
  ../../here        ../..        ../..        ../..        ../..
      //tmp/       //tmp/           //        //tmp            /
       /tmp/        /tmp/            /         /tmp            /
      ./tmp/       ./tmp/            .        ./tmp            .
 ../../here/  ../../here/        ../..   ../../here        ../..

Reply via email to