[2016-09-21 14:47] Dmitry Bogatov <kact...@gnu.org>
>
> part       text/plain                 865
> 
> > Thanks I found the problem. I use ``cd -'' to go back to the working 
> > direktorie,
> > but this prints the direktory which is changed to. Can you conform the 
> > attached
> > patch fixs your bug.
> >
> > Philipp
> > part 2     text/x-diff                267 whatnow2.patch
> > diff --git a/uip/whatnow2.sh b/uip/whatnow2.sh
> > index 543dbe5..22be353 100755
> > --- a/uip/whatnow2.sh
> > +++ b/uip/whatnow2.sh
> > @@ -75,7 +75,7 @@ get_realpath()
> >     filename=`basename "$1"`
> >     cd $reldir
> >     echo "$PWD/$filename"
> > -   cd -
> > +   cd $OLDPWD
> >  }
> 
> Confirm. Fixed.
> 
> But I would still like to hear opinions about taking advantage of
> `realpath(1)'.

As you mentioned in your previous mail realpath[0] is not part of posix.
We don't want to depend on a non standard tool or library.  Yes we do
this with ``gpg'' and ``file -b --mime'', but these tools aren't that
easy to replace. I have a 5 line script to replace this 82 LoC
c-program[1]. So I don't see the improvement of realpath.

We can discuss about adding a file exist test to attach() or
get_realpath().

Philipp

Ps: I have looked up the readlink documentation wrong, -f is a optional
parameter according to the man page, but required by the code. It is not
documented what it does.

[0]: As a binary, not the c-function.
[1]: ``wc -l /usr/src/bin/realpath/realpath.c'' on FreeBSD

Reply via email to